소스 검색

overlay always check first schema interface

the first interface has all the constant in's
Joseph Brandenburg 1 주 전
부모
커밋
fb1d3984c4
3개의 변경된 파일과 14개의 추가작업 그리고 10개의 파일을 삭제
  1. 8 1
      execution/readtree.py
  2. 2 2
      execution/schema_solve.py
  3. 4 7
      internal_nodes.py

+ 8 - 1
execution/readtree.py

@@ -175,6 +175,7 @@ def node_scan_overlays(node, socket_id,):
     from ..utilities.utilities import get_ui_node
     ui_node = get_ui_node(node.ui_signature, node.base_tree)
     # we'll assume that the overlay tag system checked if this is linked.
+    # TODO this is probably redundant with the check above this
     # First let's check if it is a simple input node, by checking outputs that are marked "input"
     for socket in ui_node.outputs:
         # weird edge case for simple input nodes with unnamed sockets
@@ -201,7 +202,13 @@ def node_scan_overlays(node, socket_id,):
         if current_schema_interface_index < 0: # this indicates that it is not in a schema
             interface = interface_nodes.get(
                 interface_signature := (*node.signature[:index+1], "InputInterface"))
-        else:
+        else: # First we get the interface that enters the schema (index 0)
+            interface = interface_nodes.get(
+                interface_signature := (*node.signature[:index+1],
+                "InputInterface."+str( 0 ).zfill(4)))
+            if interface not in my_interfaces: my_interfaces.append(interface)
+            if current_schema_interface_index == 0: continue # just did it
+            # we need to get the schema of the current index
             interface = interface_nodes.get(
                 interface_signature := (*node.signature[:index+1],
                 "InputInterface."+str(current_schema_interface_index).zfill(4)))

+ 2 - 2
execution/schema_solve.py

@@ -175,8 +175,8 @@ class SchemaSolver:
             interface.generated_at_schema_index = self.node.generated_at_schema_index + [i]
             # add the index and length socket constants
             interface.parameters['Index'] = i
-            # if i == 0: # TODO I am duplicating Length for the interface feature, this is not necessary
-            interface.parameters['Length'] = self.solve_length
+            if i == 0: # TODO I am duplicating Length for the interface feature, this is not necessary
+                interface.parameters['Length'] = self.solve_length
             # the GroupInterface will initialize with the right sockets, but we still have to link them
 
             if in_out == 'SCHEMA_INPUT': # Take the links into the schema and plug them here

+ 4 - 7
internal_nodes.py

@@ -154,14 +154,11 @@ class GroupInterface(MantisNode):
         self.in_out = in_out
         # init the sockets based on in/out, then set up traversal
         
-        # TODO: I'm adding length everywhere for now so overlays work
-        # need a more complex interface lookup for overlays to work w/out dupe length
-        # if self.in_out == 'SCHEMA_INPUT': # the length is, in reality, a constant input
-        #     self.outputs["Length"] = NodeSocket(is_input=False, node=self, name="Length")
-        # so the above should be here and below should omit length, end TODO
-        if 'SCHEMA' in self.in_out: # the index like a constant in for each iteration
-            self.outputs["Index"]  = NodeSocket(is_input=False, node=self, name="Index")
+        # the index and length are like constant inputs.
+        if self.in_out == 'SCHEMA_INPUT':
             self.outputs["Length"] = NodeSocket(is_input=False, node=self, name="Length")
+        if 'SCHEMA' in self.in_out: 
+            self.outputs["Index"]  = NodeSocket(is_input=False, node=self, name="Index")
                
         for i, item in enumerate(items_tree):
             if item.item_type == 'PANEL': continue