|
|
@@ -98,39 +98,39 @@ from .base_definitions import replace_types, NodeSocket
|
|
|
def autogen_node(base_tree, ui_socket, signature, mContext):
|
|
|
mantis_node=None
|
|
|
from .utilities import gen_nc_input_for_data
|
|
|
- nc_cls = gen_nc_input_for_data(ui_socket)
|
|
|
- if (nc_cls):
|
|
|
- mantis_node = nc_cls(signature, base_tree)
|
|
|
- mantis_node.mContext = mContext
|
|
|
- mantis_node.execution_prepared=True
|
|
|
- mantis_node.outputs.init_sockets([ui_socket.name])
|
|
|
- mantis_node.ui_signature = None # does not exist in the UI
|
|
|
+ # nc_cls = gen_nc_input_for_data(ui_socket)
|
|
|
+ # if (nc_cls):
|
|
|
+ from .internal_containers import AutoGenNode
|
|
|
+ mantis_node = AutoGenNode(signature, base_tree)
|
|
|
+ mantis_node.mContext = mContext
|
|
|
+ mantis_node.outputs.init_sockets([ui_socket.name])
|
|
|
+ mantis_node.ui_signature = None # does not exist in the UI
|
|
|
return mantis_node
|
|
|
|
|
|
# TODO: investigate whether I can set the properties in the downstream nodes directly.
|
|
|
# I am doing this in Schema Solver and it seems to work quite efficiently.
|
|
|
def make_connections_to_ng_dummy(base_tree, tree_path_names, local_nc, all_nc, nc_to):
|
|
|
- np = nc_to.prototype
|
|
|
- for inp in np.inputs:
|
|
|
+ from .socket_definitions import no_default_value
|
|
|
+ for inp in nc_to.prototype.inputs:
|
|
|
+ if inp.bl_idname in no_default_value:
|
|
|
+ continue
|
|
|
nc_from = None
|
|
|
- if inp.bl_idname in ['WildcardSocket']:
|
|
|
- continue # it isn't a real input so I don't think it is good to check it.
|
|
|
to_s = inp.identifier
|
|
|
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, np.name, inp.name, inp.identifier, str(uuid4()))
|
|
|
+ signature = ("MANTIS_AUTOGENERATED", *tree_path_names, nc_to.ui_signature[-1], inp.name, inp.identifier, str(uuid4()))
|
|
|
nc_from = all_nc.get(signature) # creating this without checking and
|
|
|
# using UUID signature leads to TERRIBLE CONFUSING BUGS.
|
|
|
if nc_from is None:
|
|
|
nc_from = autogen_node(base_tree, inp, signature, nc_to.mContext)
|
|
|
+ from .node_container_common import get_socket_value
|
|
|
if nc_from: # autogen can fail and we should catch it.
|
|
|
- from .node_container_common import get_socket_value
|
|
|
nc_from.parameters = {inp.name:get_socket_value(inp)}
|
|
|
local_nc[signature] = nc_from; all_nc[signature] = nc_from
|
|
|
nc_from.outputs[inp.name].connect(node=nc_to, socket=to_s, sort_id=0)
|
|
|
else:
|
|
|
- prRed("No available auto-generated class for input", *tree_path_names, inp.name, np.name)
|
|
|
+ prRed("No available auto-generated class for input %s in %s" % (inp.name, np.name))
|
|
|
|
|
|
def gen_node_containers(base_tree, current_tree, tree_path_names, all_nc, local_nc, dummy_nodes, group_nodes, schema_nodes ):
|
|
|
from .internal_containers import DummyNode
|