|
@@ -61,7 +61,7 @@ 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
|
|
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.
|
|
# This can be run inside schema. Make it unique with uuid() to be safe.
|
|
|
from uuid import uuid4
|
|
from uuid import uuid4
|
|
|
- signature = ("MANTIS_AUTOGENERATED", *tree_path_names, to_mantis_node.ui_signature[-1], inp.identifier, inp.identifier, str(uuid4()))
|
|
|
|
|
|
|
+ signature = (None, *tree_path_names, to_mantis_node.ui_signature[-1]+"_"+inp.name+"_"+inp.identifier+"_"+str(uuid4()) )
|
|
|
from_mantis_node = all_mantis_nodes.get(signature) # creating this without checking and
|
|
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:
|
|
if from_mantis_node is None:
|
|
@@ -178,8 +178,10 @@ forbidden_key_names = ["",]
|
|
|
forbidden_in_key_name = ['$',]
|
|
forbidden_in_key_name = ['$',]
|
|
|
def node_scan_overlays(node, socket_id,):
|
|
def node_scan_overlays(node, socket_id,):
|
|
|
from ..misc_nodes import SimpleInputNode
|
|
from ..misc_nodes import SimpleInputNode
|
|
|
|
|
+ from ..internal_nodes import AutoGenNode
|
|
|
|
|
+ from ..utilities.utilities import get_ui_node
|
|
|
overlay_data_type = str
|
|
overlay_data_type = str
|
|
|
- if isinstance(node, SimpleInputNode):
|
|
|
|
|
|
|
+ if isinstance(node, (SimpleInputNode,AutoGenNode) ):
|
|
|
overlay_data_type = type(node.parameters[list(node.outputs.values())[0].name])
|
|
overlay_data_type = type(node.parameters[list(node.outputs.values())[0].name])
|
|
|
else:
|
|
else:
|
|
|
match node.inputs[socket_id].socket_type:
|
|
match node.inputs[socket_id].socket_type:
|
|
@@ -189,25 +191,28 @@ def node_scan_overlays(node, socket_id,):
|
|
|
overlay_data_type = float
|
|
overlay_data_type = float
|
|
|
from ..utilities.node_common import GraphError
|
|
from ..utilities.node_common import GraphError
|
|
|
interface_nodes = node.mContext.interface_nodes
|
|
interface_nodes = node.mContext.interface_nodes
|
|
|
- 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
|
|
|
|
|
- # the socket.identifier is not used by Mantis but it defaults to 'socket'\
|
|
|
|
|
- if socket.identifier == socket_id and socket.input == True: break
|
|
|
|
|
- else:
|
|
|
|
|
- for socket in ui_node.inputs:
|
|
|
|
|
- if socket.identifier == socket_id: break
|
|
|
|
|
|
|
+ if not isinstance(node, AutoGenNode):
|
|
|
|
|
+ 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
|
|
|
|
|
+ # the socket.identifier is not used by Mantis but it defaults to 'socket'\
|
|
|
|
|
+ if socket.identifier == socket_id and socket.input == True: break
|
|
|
else:
|
|
else:
|
|
|
- raise KeyError(f"Socket not found by ID {socket_id} in node {node.ui_signature}\n"
|
|
|
|
|
- f"Candidates: {[socket.identifier for socket in ui_node.inputs]}")
|
|
|
|
|
|
|
+ for socket in ui_node.inputs:
|
|
|
|
|
+ if socket.identifier == socket_id: break
|
|
|
|
|
+ else:
|
|
|
|
|
+ raise KeyError(f"Socket not found by ID {socket_id} in node {node.ui_signature}\n"
|
|
|
|
|
+ f"Candidates: {[socket.identifier for socket in ui_node.inputs]}")
|
|
|
|
|
+
|
|
|
|
|
+ value = socket.default_value # get the ACTUAL UI value
|
|
|
|
|
+ if hasattr(socket, 'overlay_text'): # TODO this is all wrong but for now
|
|
|
|
|
+ value = "$"+socket.overlay_text # I am not implementing the Parser feature
|
|
|
|
|
+ else: # since it doesn't have a UI node
|
|
|
|
|
+ value = node.parameters[socket_id]
|
|
|
|
|
|
|
|
- value = socket.default_value # get the ACTUAL UI value
|
|
|
|
|
- if hasattr(socket, 'overlay_text'): # TODO this is all wrong but for now
|
|
|
|
|
- value = "$"+socket.overlay_text # I am not implementing the Parser feature
|
|
|
|
|
if not isinstance(value, str): return
|
|
if not isinstance(value, str): return
|
|
|
# First step: get the interface nodes and the overlay keys
|
|
# First step: get the interface nodes and the overlay keys
|
|
|
# this should only check interfaces that are ancestors of this node
|
|
# this should only check interfaces that are ancestors of this node
|
|
@@ -223,13 +228,14 @@ def node_scan_overlays(node, socket_id,):
|
|
|
interface = interface_nodes.get(
|
|
interface = interface_nodes.get(
|
|
|
interface_signature := (*node.signature[:index+1],
|
|
interface_signature := (*node.signature[:index+1],
|
|
|
"InputInterface."+str( 0 ).zfill(4)))
|
|
"InputInterface."+str( 0 ).zfill(4)))
|
|
|
- if interface not in my_interfaces: my_interfaces.append(interface)
|
|
|
|
|
|
|
+ if interface and interface not in my_interfaces: my_interfaces.append(interface)
|
|
|
if current_schema_interface_index == 0: continue # just did it
|
|
if current_schema_interface_index == 0: continue # just did it
|
|
|
# we need to get the schema of the current index
|
|
# we need to get the schema of the current index
|
|
|
interface = interface_nodes.get(
|
|
interface = interface_nodes.get(
|
|
|
interface_signature := (*node.signature[:index+1],
|
|
interface_signature := (*node.signature[:index+1],
|
|
|
"InputInterface."+str(current_schema_interface_index).zfill(4)))
|
|
"InputInterface."+str(current_schema_interface_index).zfill(4)))
|
|
|
- my_interfaces.append( interface )
|
|
|
|
|
|
|
+ if interface:
|
|
|
|
|
+ my_interfaces.append( interface )
|
|
|
# the my_interfaces list is sorted in REVERSE order of importance
|
|
# the my_interfaces list is sorted in REVERSE order of importance
|
|
|
# Next, get all the overlay providers.
|
|
# Next, get all the overlay providers.
|
|
|
name_to_id_map = {}
|
|
name_to_id_map = {}
|