diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 1461a7a4d5..b78601af86 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -305,7 +305,7 @@ static ObjectDataViewModel* list_model() static const Selection& get_selection() { - return plater()->canvas3D()->get_selection(); + return plater()->get_current_canvas3D(true)->get_selection(); } // category -> vector ( option ; label ) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index b27acf2ac4..c4cf0f0afa 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1838,7 +1838,7 @@ struct Plater::priv bool is_view3D_layers_editing_enabled() const { return (current_panel == view3D) && view3D->get_canvas3d()->is_layers_editing_enabled(); } void set_current_canvas_as_dirty(); - GLCanvas3D* get_current_canvas3D(); + GLCanvas3D* get_current_canvas3D(bool exclude_preview = false); void unbind_canvas_event_handlers(); void reset_canvas_volumes(); @@ -6595,11 +6595,11 @@ void Plater::priv::set_current_canvas_as_dirty() assemble_view->set_as_dirty(); } -GLCanvas3D* Plater::priv::get_current_canvas3D() +GLCanvas3D* Plater::priv::get_current_canvas3D(bool exclude_preview) { if (current_panel == view3D) return view3D->get_canvas3d(); - else if (current_panel == preview) + else if (!exclude_preview && (current_panel == preview)) return preview->get_canvas3d(); else if (current_panel == assemble_view) return assemble_view->get_canvas3d(); @@ -10295,9 +10295,9 @@ GLCanvas3D* Plater::get_assmeble_canvas3D() return nullptr; } -GLCanvas3D* Plater::get_current_canvas3D() +GLCanvas3D* Plater::get_current_canvas3D(bool exclude_preview) { - return p->get_current_canvas3D(); + return p->get_current_canvas3D(exclude_preview); } void Plater::arrange() diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 70fe1b0cfe..c03607a7d1 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -404,7 +404,7 @@ public: bool is_single_full_object_selection() const; GLCanvas3D* canvas3D(); const GLCanvas3D * canvas3D() const; - GLCanvas3D* get_current_canvas3D(); + GLCanvas3D* get_current_canvas3D(bool exclude_preview = false); GLCanvas3D* get_view3D_canvas3D(); GLCanvas3D* get_preview_canvas3D(); GLCanvas3D* get_assmeble_canvas3D();