Conversation
…ts (Orca OrcaSlicer#15728 adapt) Count physical slots from filament_colour, clamp mixed_filament_definitions to that count on load and before grow, and keep valid custom mixed rows while discarding orphan tails. Compatible with the already-merged Snapmaker#866 physical-to-mixed remap path; does not introduce filament_is_mixed. Co-authored-by: aceRage <aceRage@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adapt OrcaSlicer#15728 (fixes Orca OrcaSlicer#15717) onto Edge’s
MixedFilamentManagerpath. Not a blind port — Edge does not use Orcafilament_is_mixedparallel arrays.Projects with stale, short, or missing
mixed_filament_definitionscould break “add filament” by resurrecting orphan mixed rows once a new physical slot made those IDs valid. Slot count is now taken fromfilament_colour/ physical presets, not mixed defs.mixed_filament_definitionsto the physical colour count. Valid custom mixed rows are kept; rows that name IDs beyond that count (and unparsable garbage) are dropped.load_custom_entriesduringset_num_filamentsgrowth, clamp mixed defs to the old physical count so a stale tail cannot become a custom row on the new slot. New physical slots stay physical; auto pairs for the new count are generated fresh.set_num_filaments(batch-match / Fix filament state after physical-to-mixed merging Snapmaker/OrcaSlicer#866 grow), remap still uses the previousfilament_presetscount so painted virtual IDs shift correctly.Affected files:
src/libslic3r/MixedFilament.hpp/.cpp—clamp_serialized_entries_to_physical_countsrc/libslic3r/PresetBundle.hpp/.cpp—num_physical_filaments, load normalize, grow clampsrc/slic3r/GUI/Plater.cpp— add-filament physical counttests/libslic3r/test_mixed_filament.cpp— incomplete metadata 0 / 1 / oversized casesNo
filament_is_mixeddiscriminator is introduced. No API, profile, or dependency changes.Screenshots/Recordings/Graphs
This is load/grow metadata repair, not a UI layout change. GUI add-filament with a truncated 3MF still needs a desktop build; this environment does not run the wxWidgets app.
Tests
test_mixed_filament.cppfor clamp sizes 0 / 1 / oversized, add-with-incomplete, load preserve-real-mixed, load-then-addcmake --build build --target libslic3r_teststhen./tests/libslic3r/libslic3r_tests "[IncompleteMetadata]"[MixedFilament][shrink]/ grow remap cases (Edge PR fix(gui): sync painted/state UI after physical-to-mixed filament merge (Snapmaker #866) #38 / Fix filament state after physical-to-mixed merging Snapmaker/OrcaSlicer#866) still pass