diff --git a/src/slic3r/GUI/Jobs/ArrangeJob2.hpp b/src/slic3r/GUI/Jobs/ArrangeJob2.hpp index 31d51e9124..a4130ee4d6 100644 --- a/src/slic3r/GUI/Jobs/ArrangeJob2.hpp +++ b/src/slic3r/GUI/Jobs/ArrangeJob2.hpp @@ -58,9 +58,15 @@ public: typename decltype(std::declval().process_native( std::declval()))::element_type; + // All callbacks are called in the main thread. struct Callbacks { + // Task is prepared but not no processing has been initiated std::function on_prepared; + + // Task has been completed but the result is not yet written (inside finalize) std::function on_processed; + + // Task result has been written std::function on_finished; }; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6799b9c062..7d137698cf 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6279,7 +6279,7 @@ void Plater::fill_bed_with_instances() ModelObject *model_object = prototype_mi->get_object(); assert(model_object); -// model_object->ensure_on_bed(); + model_object->ensure_on_bed(); size_t inst_cnt = model_object->instances.size(); if (inst_cnt == 0) @@ -6290,19 +6290,17 @@ void Plater::fill_bed_with_instances() if (object_idx < 0 || object_idx >= int(model().objects.size())) return; - int added_cnt = result.to_add.size(); + update(static_cast(UpdateParams::FORCE_FULL_SCREEN_REFRESH)); - if (added_cnt > 0) { - update(static_cast(UpdateParams::FORCE_FULL_SCREEN_REFRESH)); + if (!result.to_add.empty()) { + auto added_cnt = result.to_add.size(); // FIXME: somebody explain why this is needed for // increase_object_instances - if (inst_cnt == 1) + if (result.arranged_items.size() == 1) added_cnt++; - sidebar() - .obj_list() - ->increase_object_instances(object_idx, size_t(added_cnt)); + sidebar().obj_list()->increase_object_instances(object_idx, added_cnt); } };