From 45224eee217e3590b768d938246dddfdc5f4a12c Mon Sep 17 00:00:00 2001 From: Vovodroid Date: Thu, 11 Jul 2024 18:54:42 +0300 Subject: [PATCH] Auto arrange plate after cloning (#6009) * Auto arrange plate after cloning --- src/libslic3r/AppConfig.cpp | 4 ++++ src/slic3r/GUI/Plater.cpp | 2 ++ src/slic3r/GUI/Preferences.cpp | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index 51b7a10372f..50f89935f02 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -253,6 +253,10 @@ void AppConfig::set_defaults() set_bool("show_splash_screen", true); } + if(get("auto_arrange").empty()) { + set_bool("auto_arrange", true); + } + if (get("show_model_mesh").empty()) { set_bool("show_model_mesh", false); } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 2d7f4433e1a..e810c4d7f71 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -13260,6 +13260,8 @@ void Plater::clone_selection() } Selection& selection = p->get_selection(); selection.clone(res); + if (wxGetApp().app_config->get("auto_arrange") == "true") + this->arrange(); } std::vector Plater::get_empty_cells(const Vec2f step) diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index 79b3cd2646c..0ba2af116c5 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -1133,6 +1133,7 @@ wxWindow* PreferencesDialog::create_general_page() auto item_calc_in_long_retract = create_item_checkbox(_L("Flushing volumes: Auto-calculate every time when the filament is changed."), page, _L("If enabled, auto-calculate every time when filament is changed"), 50, "auto_calculate_when_filament_change"); auto item_remember_printer_config = create_item_checkbox(_L("Remember printer configuration"), page, _L("If enabled, Orca will remember and switch filament/process configuration for each printer automatically."), 50, "remember_printer_config"); auto item_multi_machine = create_item_checkbox(_L("Multi-device Management(Take effect after restarting Orca)."), page, _L("With this option enabled, you can send a task to multiple devices at the same time and manage multiple devices."), 50, "enable_multi_machine"); + auto item_auto_arrange = create_item_checkbox(_L("Auto arrange plate after cloning"), page, _L("Auto arrange plate after object cloning"), 50, "auto_arrange"); auto title_presets = create_item_title(_L("Presets"), page, _L("Presets")); auto title_network = create_item_title(_L("Network"), page, _L("Network")); auto item_user_sync = create_item_checkbox(_L("Auto sync user presets(Printer/Filament/Process)"), page, _L("User Sync"), 50, "sync_user_preset"); @@ -1205,6 +1206,7 @@ wxWindow* PreferencesDialog::create_general_page() sizer_page->Add(item_hints, 0, wxTOP, FromDIP(3)); sizer_page->Add(item_calc_in_long_retract, 0, wxTOP, FromDIP(3)); sizer_page->Add(item_multi_machine, 0, wxTOP, FromDIP(3)); + sizer_page->Add(item_auto_arrange, 0, wxTOP, FromDIP(3)); sizer_page->Add(title_presets, 0, wxTOP | wxEXPAND, FromDIP(20)); sizer_page->Add(item_calc_mode, 0, wxTOP, FromDIP(3)); sizer_page->Add(item_user_sync, 0, wxTOP, FromDIP(3));