浏览代码

fix: Socket Updates fail if link node is not connected to xForm

Joseph Brandenburg 5 月之前
父节点
当前提交
e642dd1f46
共有 2 个文件被更改,包括 3 次插入0 次删除
  1. 2 0
      base_definitions.py
  2. 1 0
      socket_definitions.py

+ 2 - 0
base_definitions.py

@@ -752,6 +752,8 @@ class MantisNode:
     def update_socket_value(self, blender_property, value) -> bool:
     def update_socket_value(self, blender_property, value) -> bool:
         change_handled=False
         change_handled=False
         if self.node_type == 'LINK':
         if self.node_type == 'LINK':
+            if len(self.bObject) == 0: # - there are no downstream xForms
+                return True # so there is nothing to do here 
             for b_ob in self.bObject:
             for b_ob in self.bObject:
                 try:
                 try:
                     setattr(b_ob, blender_property, value)
                     setattr(b_ob, blender_property, value)

+ 1 - 0
socket_definitions.py

@@ -275,6 +275,7 @@ def default_update(ui_socket, context, do_execute=True):
             # check to see if the mantis node is in the same ui-tree as this ui_socket
             # check to see if the mantis node is in the same ui-tree as this ui_socket
             if mantis_node.ui_signature[-1] == ui_socket.node.name and \
             if mantis_node.ui_signature[-1] == ui_socket.node.name and \
                         tree_from_nc(mantis_node.ui_signature, node_tree) == ui_socket.node.id_data:
                         tree_from_nc(mantis_node.ui_signature, node_tree) == ui_socket.node.id_data:
+                node_updated = True
                 from .misc_nodes import SimpleInputNode
                 from .misc_nodes import SimpleInputNode
                 if isinstance(mantis_node, SimpleInputNode):
                 if isinstance(mantis_node, SimpleInputNode):
                     node_updated = socket_update(mantis_node, ui_socket)
                     node_updated = socket_update(mantis_node, ui_socket)