mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-26 17:48:35 -07:00
FIX: crash when delete filaments
1.fix crash when deleting filaments after sync ams or inital start up jira:NONE Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: I00c96fcebf7e0fbc127414eae44f184e3caf4dd9 (cherry picked from commit 6fb0ef6e68ed673d04c1c2311835e9988b1c70d3) (cherry picked from commit 78b00bd0e3243bc4a4d1b72547b02ee85bf7a19a)
This commit is contained in:
parent
c0cda458e5
commit
4ecffb196d
1 changed files with 6 additions and 0 deletions
|
|
@ -1730,6 +1730,9 @@ void PresetBundle::load_selections(AppConfig &config, const PresetPreferences& p
|
|||
filament_colors.resize(filament_presets.size(), "#26A69A");
|
||||
project_config.option<ConfigOptionStrings>("filament_colour")->values = filament_colors;
|
||||
|
||||
std::vector<int> filament_maps(filament_colors.size(), 1);
|
||||
project_config.option<ConfigOptionInts>("filament_map")->values = filament_maps;
|
||||
|
||||
std::vector<std::string> extruder_ams_count_str;
|
||||
if (config.has("presets", "extruder_ams_count")) {
|
||||
boost::algorithm::split(extruder_ams_count_str, config.get("presets", "extruder_ams_count"), boost::algorithm::is_any_of(","));
|
||||
|
|
@ -1996,6 +1999,9 @@ unsigned int PresetBundle::sync_ams_list(unsigned int &unknowns)
|
|||
ConfigOptionStrings *filament_color = project_config.option<ConfigOptionStrings>("filament_colour");
|
||||
filament_color->resize(filament_presets.size());
|
||||
filament_color->values = filament_colors;
|
||||
ConfigOptionInts* filament_map = project_config.option<ConfigOptionInts>("filament_map");
|
||||
filament_map->values.resize(filament_colors.size(), 1);
|
||||
|
||||
update_multi_material_filament_presets();
|
||||
return filament_presets.size();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue