Kaynağa Gözat

Fix: check when constraint can't find target

fix when a constraint/deformer can't find a target because of a missing node group input. Now it will just print a warning instead of failing.
Joseph Brandenburg 8 ay önce
ebeveyn
işleme
c8c596d943
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      node_container_common.py

+ 3 - 0
node_container_common.py

@@ -338,6 +338,9 @@ def get_target_and_subtarget(node_container, linkOb, input_name = "Target"):
     from bpy.types import PoseBone, Object, SplineIKConstraint, ArmatureModifier, HookModifier
     subtarget = ''; target = node_container.evaluate_input(input_name)
     if target:
+        if not hasattr(target, "bGetObject"):
+            prRed(f"No {input_name} target found for {linkOb.name} in {node_container} because there is no connected node, or node is wrong type")
+            return 
         if (isinstance(target.bGetObject(), PoseBone)):
             subtarget = target.bGetObject().name
             target = target.bGetParentArmature()