return # do nothing for reference to already dead shape
aDeadShape = anObj.MakeDead()
+ aMeshSObject = aSO.GetFather()
+ aMeshObject = aMeshSObject.GetObject()
+
aBuilder = aStudy.NewBuilder()
aBuilder.RemoveReference(aSO) # reset reference to the dead shape
aBuilder.Addreference(aSO, aDeadShape.GetSO())
- # Replace shape object in the parent mesh
- aMeshSObject = aSO.GetFather()
- aMeshObject = aMeshSObject.GetObject()
- aMeshObject.ReplaceShape(aDeadShape)
-
# check also sub-structure of the mesh to find references to sub-objects that become dead
aRoot = aSO.GetFather()
anIters = [aStudy.NewChildIterator(aRoot)]
aBuilder.RemoveReference(aSubSO) # reset reference to the dead shape
aBuilder.Addreference(aSubSO, aDeadSubSO)
aDeadIter.Next()
+
+ # Replace shape object in the parent mesh
+ aMeshObject.ReplaceShape(aDeadShape)
+