Salome HOME
Call aMeshObject.ReplaceShape() after updating references in the study
authoreap <eap@opencascade.com>
Tue, 21 Jan 2020 14:43:53 +0000 (17:43 +0300)
committereap <eap@opencascade.com>
Tue, 21 Jan 2020 14:43:53 +0000 (17:43 +0300)
src/PY/SHAPERSTUDY.py

index f052939d907b1bf032d6a22d8b21e73fe9f245e2..9d32e04c41cc76e259f5d21d25c6908d5fa89acf 100644 (file)
@@ -495,15 +495,13 @@ class SHAPERSTUDY(SHAPERSTUDY_ORB__POA.Gen,
           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)]
@@ -551,3 +549,7 @@ class SHAPERSTUDY(SHAPERSTUDY_ORB__POA.Gen,
                     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)
+