Tech ENABLE_WIPETOWER_OBJECTID_1000_REMOVAL - Removal of wipe tower magic object_id equal to 1000

This commit is contained in:
enricoturri1966 2022-01-17 15:56:58 +01:00
parent cfe8aa4818
commit 2cebe16663
8 changed files with 108 additions and 4 deletions
src/slic3r/GUI

View file

@ -1931,9 +1931,15 @@ void ObjectList::del_layers_from_object(const int obj_idx)
bool ObjectList::del_subobject_from_object(const int obj_idx, const int idx, const int type)
{
assert(idx >= 0);
if (obj_idx == 1000 || idx<0)
#if ENABLE_WIPETOWER_OBJECTID_1000_REMOVAL
if (m_objects->empty() || int(m_objects->size()) <= obj_idx)
// Cannot delete a wipe tower
return false;
#else
if (obj_idx == 1000 || idx<0)
// Cannot delete a wipe tower or volume with negative id
return false;
#endif // ENABLE_WIPETOWER_OBJECTID_1000_REMOVAL
ModelObject* object = (*m_objects)[obj_idx];