Skip to content

Preserve loaded filament palette when importing colored 3MF files#60

Open
gigq wants to merge 2 commits intoratdoux:mainfrom
gigq:preserve-loaded-palette-import
Open

Preserve loaded filament palette when importing colored 3MF files#60
gigq wants to merge 2 commits intoratdoux:mainfrom
gigq:preserve-loaded-palette-import

Conversation

@gigq
Copy link

@gigq gigq commented Mar 22, 2026

Summary

This changes colored 3MF import so the app keeps the user's currently loaded physical filaments instead of replacing them with the colors embedded in the 3MF project.

When a colored 3MF is imported, the importer now:

  • reads the target filament colors from the file
  • approximates those targets using the currently loaded physical filament palette
  • creates/reuses virtual mixed filaments for the imported colors
  • remaps imported model extruder assignments to those physical or virtual filament IDs

This also fixes a UI refresh issue where physical filament swatches could stay stale after import when the filament count did not change, and refreshes mixed filament display colors for manual-pattern entries.

Why

Before this change, importing a colored 3MF could overwrite the visible filament colors in slots 1-4 with the file's palette, even when the user wanted to keep a fixed physical palette loaded and approximate the model colors from that palette.

That caused the sidebar swatches, multicolor preview, and actual print intent to drift apart.

What changed

  • preserve the existing physical filament palette during colored 3MF import
  • synthesize imported colors into mixed virtual filaments instead of replacing slots 1-4
  • remap imported model extruder assignments onto the synthesized physical/virtual filament IDs
  • refresh physical filament combo swatches even when the filament count stays the same
  • refresh mixed filament display colors for manual-pattern entries
  • normalize imported 8-digit hex color values to RGB before matching

Notes

This is a heuristic color approximation based on the currently loaded palette. It improves import behavior for fixed-palette workflows, but it is not a full physical pigment/translucency model and does not guarantee exact printed color matching.

@gigq gigq mentioned this pull request Mar 22, 2026
1 task
@gigq
Copy link
Author

gigq commented Mar 23, 2026

Here is the results from a CYMK print of Yoshi, after importing it will auto add the colors from the 3mf file so no need to calculate or guess at the best mix.

image

image

image

image

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.

1 participant