diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index f977f5fd3..d43c9adf7 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1320,10 +1320,12 @@ void GLCanvas3D::Selection::add_all() return; m_mode = Instance; + clear(); for (unsigned int i = 0; i < (unsigned int)m_volumes->size(); ++i) { - _add_volume(i); + if (!(*m_volumes)[i]->is_wipe_tower) + _add_volume(i); } _update_type(); @@ -1399,6 +1401,12 @@ bool GLCanvas3D::Selection::is_single_full_instance() const return false; } +bool GLCanvas3D::Selection::is_from_single_object() const +{ + int idx = get_object_idx(); + return (0 <= idx) && (idx < 1000); +} + int GLCanvas3D::Selection::get_object_idx() const { return (m_cache.content.size() == 1) ? m_cache.content.begin()->first : -1; diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index f5ae70919..5787a60e7 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -501,7 +501,7 @@ public: bool is_multiple_volume() const { return m_type == MultipleVolume; } bool is_mixed() const { return m_type == Mixed; } bool is_from_single_instance() const { return get_instance_idx() != -1; } - bool is_from_single_object() const { return get_object_idx() != -1; } + bool is_from_single_object() const; bool contains_volume(unsigned int volume_idx) const { return std::find(m_list.begin(), m_list.end(), volume_idx) != m_list.end(); }