Fixed updating of cut contour in cut gizmo by comparing ObjectIDs,
for consistency with other gizmos and hopefully more robustness
This commit is contained in:
parent
3cf6d1c888
commit
8a5278354e
@ -282,21 +282,21 @@ void GLGizmoCut::update_contours()
|
||||
const GLVolume* first_glvolume = selection.get_volume(*selection.get_volume_idxs().begin());
|
||||
const BoundingBoxf3& box = first_glvolume->transformed_convex_hull_bounding_box();
|
||||
|
||||
const int object_idx = selection.get_object_idx();
|
||||
const ModelObject* model_object = wxGetApp().model().objects[selection.get_object_idx()];
|
||||
const int instance_idx = selection.get_instance_idx();
|
||||
|
||||
if (0.0 < m_cut_z && m_cut_z < m_max_z) {
|
||||
if (m_cut_contours.cut_z != m_cut_z || m_cut_contours.object_idx != object_idx || m_cut_contours.instance_idx != instance_idx) {
|
||||
if (m_cut_contours.cut_z != m_cut_z || m_cut_contours.object_id != model_object->id() || m_cut_contours.instance_idx != instance_idx) {
|
||||
m_cut_contours.cut_z = m_cut_z;
|
||||
|
||||
if (m_cut_contours.object_idx != object_idx) {
|
||||
m_cut_contours.mesh = wxGetApp().plater()->model().objects[object_idx]->raw_mesh();
|
||||
if (m_cut_contours.object_id != model_object->id()) {
|
||||
m_cut_contours.mesh = model_object->raw_mesh();
|
||||
m_cut_contours.mesh.repair();
|
||||
}
|
||||
|
||||
m_cut_contours.position = box.center();
|
||||
m_cut_contours.shift = Vec3d::Zero();
|
||||
m_cut_contours.object_idx = object_idx;
|
||||
m_cut_contours.object_id = model_object->id();
|
||||
m_cut_contours.instance_idx = instance_idx;
|
||||
m_cut_contours.contours.reset();
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#if ENABLE_SINKING_CONTOURS
|
||||
#include "slic3r/GUI/GLModel.hpp"
|
||||
#include "libslic3r/TriangleMesh.hpp"
|
||||
#include "libslic3r/ObjectID.hpp"
|
||||
#endif // ENABLE_SINKING_CONTOURS
|
||||
|
||||
namespace Slic3r {
|
||||
@ -33,7 +34,7 @@ class GLGizmoCut : public GLGizmoBase
|
||||
double cut_z{ 0.0 };
|
||||
Vec3d position{ Vec3d::Zero() };
|
||||
Vec3d shift{ Vec3d::Zero() };
|
||||
int object_idx{ -1 };
|
||||
ObjectID object_id;
|
||||
int instance_idx{ -1 };
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user