FIX:The filament color after "merge" is incorrect

jira: STUDIO-11642
Change-Id: I24aaf3e5fcbf5263d8d1c5240e8edfa38123b269
This commit is contained in:
zhou.xu 2025-04-18 09:53:34 +08:00 committed by lane.wei
parent 8946cb4b27
commit 6e09e68046

View File

@ -2859,6 +2859,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)
@ -3003,11 +3004,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);