Show current filaments at top of AMS filament dropdown #11293
+51
−2
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
Show the user's currently selected filaments for slicing at the top of the AMS Material Settings filament dropdown if those filaments are available.
When the user is opening the AMS filament selection dropdown, the user likely wants to change the filament to match their selected filament in the sliced model to print with.
We can move these active filaments to the top of the list so that the user does not need to scroll down and hunt for the exact match. This is convenient, saves time, and helps the user select the correct filament in the AMS even if they have a custom filament name.
I got the active filament preset names with
wxGetApp().preset_bundle->filament_presetsand found the matching actualPreset()from allPresets inwxGetApp().preset_bundle->filaments. Bambu has hardcoded preferred filament names to sort first intosorted_names.I add the preset's base filament
aliasbased on followinginheritsmatched to other filament'snameto the top ofsorted_namesName: Generic PETG - Alias: Generic PETG - Inherits:- no inheritsName: Bambu PLA-CF @BBL X1C - Alias: Bambu PLA-CF - Inherits:- no inheritsName: PETG Kingroon - Alias: - Inherits: Generic PETG- no aliasName Bambu PLA Silk - Bronze - Name: Bambu PLA Silk - Bronze - Alias: - Inherits: Bambu PLA Silk @BBL X1C- no alias, nested inheritI think a base filament has no
inheritsand has analiasand renamed filament based off the base filament hasinheritsbut noaliasso the inheritance back to the parent filament can be traced back byinherits (name of the inherited filament)>name>alias (alias of the inherited filament).If there is a way to get the active filament presets as
Preset()objects directly, we could use that method instead.Screenshots/Recordings/Graphs
Example user selected filaments for slicing. (PETG Kingroon inherits Generic PETG with a custom name)
Shows the following selected filaments at the top of the AMS filament dropdown.
Tests
I have tried setting my active filaments in OrcaSlicer and opening the AMS Material Selection. The top entries reflect my active filament selection.