Skip to content

Fix painted region rebuild after mixed filament edits#408

Merged
womendoushihaoyin merged 19 commits into
mainfrom
bugfix_mix_filament
May 31, 2026
Merged

Fix painted region rebuild after mixed filament edits#408
womendoushihaoyin merged 19 commits into
mainfrom
bugfix_mix_filament

Conversation

@zhangzhend0ng
Copy link
Copy Markdown
Collaborator

Description

Fixes stale painted-region reuse after editing a custom mixed filament formula.

When a painted mixed filament keeps the same virtual filament slot but changes components, for example 1+2 -> 3+2 -> 3+4, Print::apply() could reuse the old PaintedRegions table because the total filament count had not changed. That left the table with old physical targets, so slicing could keep the previous mix or fail to find the newly required physical filament target.

This PR compares cached painted-region targets against the currently required (parent region, extruder id) set. If they differ, shared print-object regions are rebuilt before slicing.

Also marks same-layer pointillism as deprecated in code.

Tests

  • Built libslic3r
  • Built libslic3r_tests
  • Ran focused regression:
    • Mixed filament component edits rebuild painted region targets
  • Ran full mixed filament test filter:
    • [MixedFilament]
    • 104 test cases, 539 assertions

ratdoux and others added 19 commits May 28, 2026 10:45
Fixes #125.

Add Local-Z Full Domain and related mixed-filament project settings to the project config and import allow-lists so they survive 3MF save/load and model import.
Fix geometry-only 3MF import so saved Local-Z project settings override the current unsaved state even when importing into a non-empty scene. Mirror the print-tab Local-Z booleans as well so the UI does not drift back to the old preset values.
Default Apply subdivision to infill to off while Subdivide Mix Layer is disabled, auto-enable it when subdivision is enabled, and clear dependent Local-Z child settings when subdivision is disabled so saved project config does not retain stale active child values.
- Reorder Show+Layout before SetLabel so hidden LB_AUTO_WRAP Label
    gets valid width for wrapping, preventing NSTextField from
    reporting overly wide intrinsicContentSize
- Clean up i18n keys: drop colons (Filaments:/Target Color:),
    fix cycle card title Pattern→Filaments
- Sync zh_CN translations
bugfix: mix dialog error/warning panel oversized on first display
After geometry-only 3MF import, reload the print tab when Local-Z settings were imported so the visible Subdivide Mix Layer controls match the project config used for slicing.
File -> Import 3MF should preserve the current project's process parameter state. Stop applying saved Local-Z project/print settings during geometry-only 3MF import; those settings are still loaded when opening a project with config.
feature update the soft version (#389)
…tence

Fix 3MF persistence for Local-Z project settings
i18n: add zh_CN translation for "Apply subdivision to infill"
…n MixedFilamentDialog

The error/warning labels use LB_AUTO_WRAP, which requires two Layout()
passes on macOS: the first lands the panel's actual width after Show(),
the second re-wraps the label text at the correct width. Without this,
a single Layout can query a stale zero-width from CalcMin and produce
an oversized dialog on first display.
docs: add inline comments explaining double-Layout macOS workaround in MixedFilamentDialog
Fix painted region rebuild after mixed filament edits
static bool painted_region_targets_match(const PrintObjectRegions &print_object_regions,
const std::vector<unsigned int> &painting_extruders)
{
std::vector<unsigned int> expected_extruders = painting_extruders;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data check for enter parameter.if it is invalid.

@@ -4,6 +4,8 @@
#include "libslic3r/PresetBundle.hpp"
#include "libslic3r/Print.hpp"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test for unit and should not have include this pr.

@womendoushihaoyin womendoushihaoyin merged commit 9921461 into main May 31, 2026
17 of 18 checks passed
NikSativa added a commit to NikSativa/OrcaSlicer-FullSpectrum that referenced this pull request Jun 2, 2026
… rebuild after mixed filament edits + U1 by-object end safety move (Snapmaker#376, Snapmaker#408)
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.

5 participants