mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 19:12:17 +00:00
FIX: crash when delete filaments
1. Manually add filament map if 3mf don't have the param jira:NONE Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: I9fcd8702d431b398fbf8356ee759ddc8e0775a68 (cherry picked from commit f3e89631f3b5fa2c66dff31c52e8c39509f0d0d2)
This commit is contained in:
@@ -4948,15 +4948,22 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||||||
q->on_filaments_change(preset_bundle->filament_presets.size());
|
q->on_filaments_change(preset_bundle->filament_presets.size());
|
||||||
is_project_file = true;
|
is_project_file = true;
|
||||||
|
|
||||||
//BBS: rewrite wipe tower pos stored in 3mf file , the code above should be seriously reconsidered
|
DynamicConfig& proj_cfg = preset_bundle->project_config;
|
||||||
|
// do some post process after loading config
|
||||||
{
|
{
|
||||||
DynamicConfig& proj_cfg = wxGetApp().preset_bundle->project_config;
|
//BBS: rewrite wipe tower pos stored in 3mf file , the code above should be seriously reconsidered
|
||||||
ConfigOptionFloats* wipe_tower_x = proj_cfg.opt<ConfigOptionFloats>("wipe_tower_x");
|
ConfigOptionFloats* wipe_tower_x = proj_cfg.opt<ConfigOptionFloats>("wipe_tower_x");
|
||||||
ConfigOptionFloats* wipe_tower_y = proj_cfg.opt<ConfigOptionFloats>("wipe_tower_y");
|
ConfigOptionFloats* wipe_tower_y = proj_cfg.opt<ConfigOptionFloats>("wipe_tower_y");
|
||||||
if (file_wipe_tower_x)
|
if (file_wipe_tower_x)
|
||||||
*wipe_tower_x = *file_wipe_tower_x;
|
*wipe_tower_x = *file_wipe_tower_x;
|
||||||
if (file_wipe_tower_y)
|
if (file_wipe_tower_y)
|
||||||
*wipe_tower_y = *file_wipe_tower_y;
|
*wipe_tower_y = *file_wipe_tower_y;
|
||||||
|
|
||||||
|
ConfigOptionStrings* filament_color = proj_cfg.opt<ConfigOptionStrings>("filament_colour");
|
||||||
|
ConfigOptionInts* filament_map = proj_cfg.opt<ConfigOptionInts>("filament_map", true);
|
||||||
|
if (filament_color && filament_color->size() != filament_map->size()) {
|
||||||
|
filament_map->values.resize(filament_color->size(), 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user