Replace with STL: Fixed update of the item name after replacing

+ OSX specific: Code refactoring for ObjectList:Rename() function
This commit is contained in:
YuSanka 2021-07-14 09:22:03 +02:00
parent 428362ec53
commit 062031a4c6
5 changed files with 55 additions and 18 deletions

View file

@ -3284,6 +3284,13 @@ void Plater::priv::replace_with_stl()
old_model_object->ensure_on_bed();
old_model_object->sort_volumes(wxGetApp().app_config->get("order_volumes") == "1");
// if object has just one volume, rename object too
if (old_model_object->volumes.size() == 1)
old_model_object->name = old_model_object->volumes[0]->name;
// update new name in ObjectList
sidebar->obj_list()->update_name_in_list(object_idx, volume_idx);
sla::reproject_points_and_holes(old_model_object);
// update 3D scene