소스 검색

Fix: reusing curve data caused confusing driver problems

Joseph Brandenburg 6 달 전
부모
커밋
e1886b2f97
1개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 4
      xForm_containers.py

+ 8 - 4
xForm_containers.py

@@ -686,10 +686,14 @@ class xFormGeometryObject(xFormNode):
             name = self.bObject.data.name
             # it has to be a curve
             data = bpy.data.curves.get(self.bObject.data.name+"_MANTIS")
-            if not data:
-                data=self.bObject.data.copy()
-                data.name = name+"_MANTIS"
-                data.animation_data_clear() # clear the drivers if there are
+            if data: # Delete it and regenerate it if it exists.
+                data.name+="_TRASH.000" # but we can't actually delete it here
+                # since previous executions of the graph may be using it.
+                # instead, we'll rename it and use a new copy. This will probably
+                # be deleted on its own by Blender's garbage collector.
+                # if it isn't, then it is still in use and I may NOT touch it.
+            data=self.bObject.data.copy(); data.animation_data_clear()
+            data.name = name+"_MANTIS"
             self.bObject.data = data
         reset_object_data(self.bObject)
         matrix= get_matrix(self)