Fixed Canvas3D update after an object instance is deleted.

This commit is contained in:
bubnikv 2018-12-04 11:35:04 +01:00
parent 60f870bbd9
commit 96e14b5d3b
4 changed files with 1 additions and 13 deletions

View file

@ -699,14 +699,6 @@ void ModelObject::clear_volumes()
this->invalidate_bounding_box();
}
void ModelObject::reset_volumes_idxs()
{
for (ModelVolume *v : this->volumes)
{
v->set_new_unique_id();
}
}
ModelInstance* ModelObject::add_instance()
{
ModelInstance* i = new ModelInstance(this);

View file

@ -200,9 +200,6 @@ public:
void clear_volumes();
bool is_multiparts() const { return volumes.size() > 1; }
// set a new unique id to all volumes
void reset_volumes_idxs();
ModelInstance* add_instance();
ModelInstance* add_instance(const ModelInstance &instance);
ModelInstance* add_instance(const Vec3d &offset, const Vec3d &scaling_factor, const Vec3d &rotation);

View file

@ -4087,7 +4087,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
volume->extruder_id = extruder_id;
// updates volumes transformations
volume->set_instance_transformation(mvs->model_volume->get_object()->instances[volume->instance_idx()]->get_transformation());
volume->set_instance_transformation(mvs->model_volume->get_object()->instances[mvs->composite_id.instance_id]->get_transformation());
volume->set_volume_transformation(mvs->model_volume->get_transformation());
}
}

View file

@ -946,7 +946,6 @@ bool ObjectList::del_subobject_from_object(const int obj_idx, const int idx, con
return false;
}
(*m_objects)[obj_idx]->delete_instance(idx);
(*m_objects)[obj_idx]->reset_volumes_idxs();
}
else
return false;