mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Fixed GLVolumes reuse after instance deletion
This commit is contained in:
parent
6693b2102d
commit
e1c90c83e8
3 changed files with 12 additions and 0 deletions
|
@ -690,6 +690,14 @@ void ModelObject::clear_volumes()
|
||||||
this->invalidate_bounding_box();
|
this->invalidate_bounding_box();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ModelObject::reset_volumes_idxs()
|
||||||
|
{
|
||||||
|
for (ModelVolume *v : this->volumes)
|
||||||
|
{
|
||||||
|
v->set_new_unique_id();
|
||||||
|
}
|
||||||
|
}//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
ModelInstance* ModelObject::add_instance()
|
ModelInstance* ModelObject::add_instance()
|
||||||
{
|
{
|
||||||
ModelInstance* i = new ModelInstance(this);
|
ModelInstance* i = new ModelInstance(this);
|
||||||
|
|
|
@ -200,6 +200,9 @@ public:
|
||||||
void clear_volumes();
|
void clear_volumes();
|
||||||
bool is_multiparts() const { return volumes.size() > 1; }
|
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();
|
||||||
ModelInstance* add_instance(const ModelInstance &instance);
|
ModelInstance* add_instance(const ModelInstance &instance);
|
||||||
ModelInstance* add_instance(const Vec3d &offset, const Vec3d &scaling_factor, const Vec3d &rotation);
|
ModelInstance* add_instance(const Vec3d &offset, const Vec3d &scaling_factor, const Vec3d &rotation);
|
||||||
|
|
|
@ -949,6 +949,7 @@ bool ObjectList::del_subobject_from_object(const int obj_idx, const int idx, con
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
(*m_objects)[obj_idx]->delete_instance(idx);
|
(*m_objects)[obj_idx]->delete_instance(idx);
|
||||||
|
(*m_objects)[obj_idx]->reset_volumes_idxs();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue