Skip to content

Backport moonraker metadata: filament_name and filament_type as array#358

Open
paxx12 wants to merge 4 commits intodevelopfrom
fix/moonraker-metadata-filament-arrays
Open

Backport moonraker metadata: filament_name and filament_type as array#358
paxx12 wants to merge 4 commits intodevelopfrom
fix/moonraker-metadata-filament-arrays

Conversation

@paxx12
Copy link
Copy Markdown
Owner

@paxx12 paxx12 commented Mar 29, 2026

Backports upstream commit 3a54161 to return filament_name and filament_type as JSON arrays for multi-material slices, fixes #355.

Also restructures patch paths under home/lava/moonraker/ to match the target filesystem layout.

paxx12 added 4 commits March 29, 2026 20:07
Backports upstream commit 3a54161 to return filament_name and
filament_type as JSON arrays for multi-material slices, fixes #355.

Also restructures patch paths under home/lava/moonraker/ to match
the target filesystem layout.
Backports upstream commit 4eb23ef before the filament array patch,
fixes regex_find_strings to correctly handle quoted values with
embedded separators.
…r PS/SS

Backports upstream commit 18f3da5 to also check "total toolchanges"
before "total filament change" for PrusaSlicer/SuperSlicer compatibility.
…usaSlicer

Backports upstream commit 6b1b8c5 to sum per-extruder filament lengths
from "filament used [mm]" instead of parsing only the first value.
@paxx12 paxx12 force-pushed the fix/moonraker-metadata-filament-arrays branch from 7df2d06 to b296657 Compare March 29, 2026 18:39
@paxx12
Copy link
Copy Markdown
Owner Author

paxx12 commented Mar 29, 2026

@gaaat98 please test this build

@gaaat98
Copy link
Copy Markdown

gaaat98 commented Mar 29, 2026

Hi, thanks a lot for the time you are dedicating to this! I am unable to build, but just looking at the changes, I can tell you this will not work because:

  1. The regex_find_strings helper is not defined in the moonraker version running on the U1, but most importantly
  2. I already tried myself porting regex_find_strings and the fix you propose here, but in the en,d it does not work because whatever calls metadata.py to parse the metadata cannot process the JSON array produced as output for the filament types, it only seems to be parsing strings separated by ;

With a correct metadata.py that implements regex_find_strings you can verify that "filament_type" becomes an array after the patch with this command:
/usr/bin/python3 /home/lava/moonraker/moonraker/components/file_manager/metadata.py -p /userdata/gcodes -f "<FILENAME.GCODE>"

We have two options here: the easy one is to take the array and return as ; separated strings or, if you can find where this metadata is processed by the firmware and patch it to parse the JSON array, I tried to locate where this happens but failed miserably.

Let me know what you think, if you can find where to patch I can work on it, or if we decide to go with the easier option, I can update the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants