Add instances (#6237)

* Add instances

* - Added a new menu item for converting instances to objects,

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Vovodroid
2025-10-26 10:13:14 +02:00
committed by GitHub
parent ca064dee1d
commit e922411371
12 changed files with 382 additions and 40 deletions

View File

@@ -13604,8 +13604,6 @@ void Plater::remove_selected()
void Plater::increase_instances(size_t num)
{
// BBS
#if 0
if (! can_increase_instances()) { return; }
Plater::TakeSnapshot snapshot(this, "Increase Instances");
@@ -13638,13 +13636,14 @@ void Plater::increase_instances(size_t num)
p->selection_changed();
this->p->schedule_background_process();
#endif
if (wxGetApp().app_config->get("auto_arrange") == "true") {
this->set_prepare_state(Job::PREPARE_STATE_MENU);
this->arrange();
}
}
void Plater::decrease_instances(size_t num)
{
// BBS
#if 0
if (! can_decrease_instances()) { return; }
Plater::TakeSnapshot snapshot(this, "Decrease Instances");
@@ -13668,7 +13667,10 @@ void Plater::decrease_instances(size_t num)
p->selection_changed();
this->p->schedule_background_process();
#endif
if (wxGetApp().app_config->get("auto_arrange") == "true") {
this->set_prepare_state(Job::PREPARE_STATE_MENU);
this->arrange();
}
}
static long GetNumberFromUser( const wxString& msg,
@@ -13713,7 +13715,7 @@ void Plater::set_number_of_copies(/*size_t num*/)
decrease_instances(-diff);
}
void Plater::fill_bed_with_instances()
void Plater::fill_bed_with_copies()
{
auto &w = get_ui_job_worker();
if (w.is_idle()) {
@@ -13722,6 +13724,15 @@ void Plater::fill_bed_with_instances()
}
}
void Plater::fill_bed_with_instances()
{
auto &w = get_ui_job_worker();
if (w.is_idle()) {
p->take_snapshot(_u8L("Arrange"));
replace_job(w, std::make_unique<FillBedJob>(true));
}
}
bool Plater::is_selection_empty() const
{
return p->get_selection().is_empty() || p->get_selection().is_wipe_tower();