FIX: do not check spiral vase mode config if an object is loaded

jira: STUDIO-6514

Change-Id: Ib44ec8322ff178b5765f7fe94b588aa38339691d
This commit is contained in:
liz.li 2024-03-22 12:31:13 +08:00 committed by Lane.Wei
parent f26df7e6ae
commit b0330dff36
3 changed files with 9 additions and 7 deletions

View File

@ -3704,7 +3704,7 @@ void ObjectList::add_object_to_list(size_t obj_idx, bool call_selection_changed,
//BBS start add obj_idx for debug
PartPlateList& list = wxGetApp().plater()->get_partplate_list();
if (notify_partplate) {
list.notify_instance_update(obj_idx, 0);
list.notify_instance_update(obj_idx, 0, true);
}
//int plate_idx = list.find_instance_belongs(obj_idx, 0);
//std::string item_name_str = (boost::format("[P%1%][O%2%]%3%") % plate_idx % std::to_string(obj_idx) % model_object->name).str();

View File

@ -4180,7 +4180,7 @@ int PartPlateList::find_instance_belongs(int obj_id, int instance_id)
//notify instance's update, need to refresh the instance in plates
//newly added or modified
int PartPlateList::notify_instance_update(int obj_id, int instance_id)
int PartPlateList::notify_instance_update(int obj_id, int instance_id, bool is_new)
{
int ret = 0, index;
PartPlate* plate = NULL;
@ -4278,10 +4278,12 @@ int PartPlateList::notify_instance_update(int obj_id, int instance_id)
plate->add_instance(obj_id, instance_id, false, &boundingbox);
// spiral mode, update object setting
if (plate->config()->has("spiral_mode") && plate->config()->opt_bool("spiral_mode") && !is_object_config_compatible_with_spiral_vase(object)) {
auto answer = static_cast<TabPrintPlate*>(wxGetApp().plate_tab)->show_spiral_mode_settings_dialog(true);
if (answer == wxID_YES) {
plate->set_vase_mode_related_object_config(obj_id);
if (!is_new) {
if (plate->config()->has("spiral_mode") && plate->config()->opt_bool("spiral_mode") && !is_object_config_compatible_with_spiral_vase(object)) {
auto answer = static_cast<TabPrintPlate*>(wxGetApp().plate_tab)->show_spiral_mode_settings_dialog(true);
if (answer == wxID_YES) {
plate->set_vase_mode_related_object_config(obj_id);
}
}
}

View File

@ -760,7 +760,7 @@ public:
int find_instance_belongs(int obj_id, int instance_id);
//notify instance's update, need to refresh the instance in plates
int notify_instance_update(int obj_id, int instance_id);
int notify_instance_update(int obj_id, int instance_id, bool is_new = false);
//notify instance is removed
int notify_instance_removed(int obj_id, int instance_id);