Преглед на файлове

Use fill_parameters for autogen node

Joseph Brandenburg преди 1 седмица
родител
ревизия
2b04d930b6
променени са 1 файла, в които са добавени 6 реда и са изтрити 11 реда
  1. 6 11
      execution/readtree.py

+ 6 - 11
execution/readtree.py

@@ -45,7 +45,8 @@ def autogen_node(base_tree, ui_socket, signature, mContext):
     from ..internal_nodes import AutoGenNode
     mantis_node = AutoGenNode(signature, base_tree)
     mantis_node.mContext = mContext
-    mantis_node.outputs[ui_socket.name] = NodeSocket(is_input=False, name=ui_socket.name, node=mantis_node)
+    mantis_node.outputs[ui_socket.identifier] = NodeSocket(is_input=False, name=ui_socket.identifier, node=mantis_node)
+    mantis_node.parameters[ui_socket.identifier] = None
     mantis_node.ui_signature = None # does not exist in the UI
     return mantis_node
 
@@ -60,22 +61,16 @@ def make_connections_to_ng_dummy(base_tree, tree_path_names, local_mantis_nodes,
         if not inp.is_linked: # make an autogenerated NC for the inputs of the group node
             # This can be run inside schema. Make it unique with uuid() to be safe.
             from uuid import uuid4
-            signature = ("MANTIS_AUTOGENERATED", *tree_path_names, to_mantis_node.ui_signature[-1], inp.name, inp.identifier, str(uuid4()))
+            signature = ("MANTIS_AUTOGENERATED", *tree_path_names, to_mantis_node.ui_signature[-1], inp.identifier, inp.identifier, str(uuid4()))
             from_mantis_node = all_mantis_nodes.get(signature) # creating this without checking and
-            #  using UUID signature leads to TERRIBLE CONFUSING BUGS.
+                                                               #  using UUID signature leads to TERRIBLE CONFUSING BUGS.
             if from_mantis_node is None: 
                 from_mantis_node = autogen_node(base_tree, inp, signature, to_mantis_node.mContext)
                 local_mantis_nodes[signature]=from_mantis_node
                 all_mantis_nodes[signature]=from_mantis_node
             if from_mantis_node: # autogen can fail and we should catch it.
-                from mathutils import Matrix
-                from_mantis_node.parameters[inp.name] = \
-                                               Matrix(( tuple(inp.default_value[0:4]), \
-                                                        tuple(inp.default_value[4:8]), \
-                                                        tuple(inp.default_value[8:12]), \
-                                                        tuple(inp.default_value[12:16]) )) if inp.bl_idname == 'MatrixSocket' \
-                                                            else inp.default_value
-                from_mantis_node.outputs[inp.name].connect(node=to_mantis_node, socket=to_s, sort_id=0)
+                from_mantis_node.fill_parameters(ui_node=to_mantis_node.ui_node)
+                from_mantis_node.outputs[inp.identifier].connect(node=to_mantis_node, socket=to_s, sort_id=0)
             else:
                 prRed("No available auto-generated class for input %s in %s" % (inp.name, to_mantis_node.ui_node.name))