From 3911344495ad022dbcbb7daae03820ac569ee4fe Mon Sep 17 00:00:00 2001 From: "yifan.wu" Date: Tue, 23 Aug 2022 22:37:57 +0800 Subject: [PATCH] FIX: fix modifier extruder not correct issue Signed-off-by: yifan.wu Change-Id: I90e639ec1bb27efb8b10f4609d3c5fcb9eebdde8 --- src/slic3r/GUI/GUI_ObjectList.cpp | 10 ++++++++-- src/slic3r/GUI/ObjectDataViewModel.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 1bb9ca0052..bf7e8bd4ec 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -1842,7 +1842,10 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo new_volume->name = boost::filesystem::path(input_file).filename().string(); // set a default extruder value, since user can't add it manually // BBS - new_volume->config.set_key_value("extruder", new ConfigOptionInt(1)); + int extruder_id = 0; + if (model_object.config.has("extruder")) + extruder_id = model_object.config.opt_int("extruder"); + new_volume->config.set_key_value("extruder", new ConfigOptionInt(extruder_id)); // update source data new_volume->source.input_file = input_file; new_volume->source.object_idx = obj_idx; @@ -1945,7 +1948,10 @@ void ObjectList::load_generic_subobject(const std::string& type_name, const Mode new_volume->name = into_u8(name); // set a default extruder value, since user can't add it manually // BBS - new_volume->config.set_key_value("extruder", new ConfigOptionInt(1)); + int extruder_id = 0; + if (model_object.config.has("extruder")) + extruder_id = model_object.config.opt_int("extruder"); + new_volume->config.set_key_value("extruder", new ConfigOptionInt(extruder_id)); new_volume->source.is_from_builtin_objects = true; select_item([this, obj_idx, new_volume]() { diff --git a/src/slic3r/GUI/ObjectDataViewModel.cpp b/src/slic3r/GUI/ObjectDataViewModel.cpp index 73e2847898..5300f5238e 100644 --- a/src/slic3r/GUI/ObjectDataViewModel.cpp +++ b/src/slic3r/GUI/ObjectDataViewModel.cpp @@ -1378,7 +1378,7 @@ void ObjectDataViewModel::UpdateVolumesExtruderBitmap(wxDataViewItem obj_item, b return; ObjectDataViewModelNode* obj_node = static_cast(obj_item.GetID()); for (auto child : obj_node->GetChildren()) - if (child->GetVolumeType() == ModelVolumeType::MODEL_PART) + if (child->GetVolumeType() == ModelVolumeType::MODEL_PART || child->GetVolumeType() == ModelVolumeType::PARAMETER_MODIFIER) child->UpdateExtruderAndColorIcon(use_obj_extruder ? obj_node->GetExtruder() : ""); }