Selaa lähdekoodia

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

Joseph Brandenburg 5 kuukautta sitten
vanhempi
commit
e642dd1f46
2 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  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:
         change_handled=False
         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:
                 try:
                     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
             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:
+                node_updated = True
                 from .misc_nodes import SimpleInputNode
                 if isinstance(mantis_node, SimpleInputNode):
                     node_updated = socket_update(mantis_node, ui_socket)