Explorar o código

Fix: socket changes in Schema don't update tree

Joseph Brandenburg hai 5 meses
pai
achega
c279680f27
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      socket_definitions.py

+ 5 - 1
socket_definitions.py

@@ -262,6 +262,9 @@ def default_update(ui_socket, context, do_execute=True):
     # finally, try and execute it if mantis couldn't update the b_objects itself.
     from .base_definitions import array_output_types
     mantis_updated=True
+    inside_schema=False
+    if ui_socket.node.id_data.bl_idname == 'SchemaTree':
+        inside_schema=True # We're inside a schema and we have to force-update
     if (ui_socket.node.bl_idname in ["MantisNodeGroup", "MantisSchemaGroup"]):
         mantis_updated=False # this kind of socket can't be updated here (yet)
         node_tree.update_tree(context, force=True)
@@ -285,7 +288,8 @@ def default_update(ui_socket, context, do_execute=True):
                     node_updated = socket_update(mantis_node, ui_socket)
                 # execute the tree if even one node didn't update
                 mantis_updated = node_updated and mantis_updated
-        node_tree.update_tree(context)
+        # we want to force it if we have made an unhandled change inside of a schema.
+        node_tree.update_tree(context, force = (mantis_updated == False and inside_schema))
     node_tree.display_update(context)
     if mantis_updated==False:
         try: