瀏覽代碼

ensure all xForms are unique for LINK nodes

this commit adds a simple check to ensure that xForms are unique results from GetxForm()
IIRC the algo that gets the xForms  could arrive at the same xForm from many paths and
thus add it to the queue more than once, resluting in duplicated constraints and deformers

I have only observed this happening in bad graphs, but it could conceivably happen in a well formed graph (?) so it doesn;t hurt to add this
Joseph Brandenburg 6 月之前
父節點
當前提交
ba1211d450
共有 2 個文件被更改,包括 6 次插入0 次删除
  1. 2 0
      deformer_containers.py
  2. 4 0
      link_containers.py

+ 2 - 0
deformer_containers.py

@@ -56,6 +56,8 @@ class MantisDeformerNode(MantisNode):
         for xf in xforms:
             if xf.node_type != 'XFORM':
                 continue
+            if xf in return_me:
+                continue
             return_me.append(xf)
         return return_me
 

+ 4 - 0
link_containers.py

@@ -89,6 +89,8 @@ class MantisLinkNode(MantisNode):
         for xf in xforms:
             if xf.node_type != 'XFORM':
                 continue
+            if xf in return_me:
+                continue
             return_me.append(xf)
         return return_me
     
@@ -797,6 +799,8 @@ class LinkSplineIK(MantisLinkNode):
 
     def bExecute(self, bContext = None,):
         prepare_parameters(self)
+        if not self.inputs['Target'].is_linked:
+            raise GraphError(f"ERROR: {self} is not connected to a target curve.")
         for xf in self.GetxForm():
             print(wrapGreen("Creating ")+wrapOrange("Spline-IK")+
                 wrapGreen(" Constraint for bone: ") +