FIX:The filament color after "merge" is incorrect

jira: STUDIO-11642
Change-Id: I24aaf3e5fcbf5263d8d1c5240e8edfa38123b269
(cherry picked from commit 6e09e68046edcb35282768ad120d232d08563295)
This commit is contained in:
zhou.xu 2025-04-18 09:53:34 +08:00 committed by Noisyfox
parent 5e0e0a7e7d
commit f4204d41ec

View file

@ -2798,6 +2798,7 @@ void ObjectList::split()
void ObjectList::merge(bool to_multipart_object)
{
wxBusyCursor wait;
// merge selected objects to the multipart object
if (to_multipart_object) {
auto get_object_idxs = [this](std::vector<int>& obj_idxs, wxDataViewItemArray& sels)
@ -2942,11 +2943,14 @@ void ObjectList::merge(bool to_multipart_object)
//for volume config, it only has settings of PrintRegionConfig
//so we can not copy settings from object to volume
//but we can copy settings from volume to object
if (object->volumes.size() > 1)
{
if (object->volumes.size() > 1){
new_volume->config.assign_config(volume->config);
}
auto option = new_volume->config.option("extruder");
if (!option) {
auto opt = object->config.option("extruder");
if (opt) { new_volume->config.set_key_value("extruder", new ConfigOptionInt(opt->getInt())); }
}
new_volume->mmu_segmentation_facets.assign(std::move(volume->mmu_segmentation_facets));
}
new_object->sort_volumes(true);