diff --git a/BlenderMalt/MaltNodes/Nodes/MaltIONode.py b/BlenderMalt/MaltNodes/Nodes/MaltIONode.py index 77f9bd3f..0bb1c270 100644 --- a/BlenderMalt/MaltNodes/Nodes/MaltIONode.py +++ b/BlenderMalt/MaltNodes/Nodes/MaltIONode.py @@ -141,8 +141,7 @@ def get_source_global_parameters(self, transpiler): src = MaltNode.get_source_global_parameters(self, transpiler) custom_outputs = '' graph_io = self.id_data.get_pipeline_graph().graph_io[self.io_type] - try: index = graph_io.custom_output_start_index - except: index = 0 + index = graph_io.custom_output_start_index for key, parameter in self.get_custom_parameters().items(): if parameter.is_output: socket = self.inputs[key] @@ -197,7 +196,13 @@ def add_custom_socket(): while f'{name} {i}' in parameters.keys(): i += 1 new_param.name = f'{name} {i}' - col.operator("wm.malt_callback", text='', icon='ADD').callback.set(add_custom_socket, 'Add') + add_row = col.row() + graph = self.id_data.get_pipeline_graph() + if (self.is_output and graph.language == 'GLSL' and + len(parameters) >= (8 - graph.graph_io[self.io_type].custom_output_start_index) and + self.id_data.graph_type.endswith("(Group)") == False): + add_row.enabled = False + add_row.operator("wm.malt_callback", text='', icon='ADD').callback.set(add_custom_socket, 'Add') def remove_custom_socket(): parameters.remove(index) col.operator("wm.malt_callback", text='', icon='REMOVE').callback.set(remove_custom_socket, 'Remove') diff --git a/Malt/PipelineGraph.py b/Malt/PipelineGraph.py index 246cc06b..39518289 100644 --- a/Malt/PipelineGraph.py +++ b/Malt/PipelineGraph.py @@ -11,6 +11,7 @@ def __init__(self, name, dynamic_input_types = [], dynamic_output_types = [], self.default_dynamic_inputs = default_dynamic_inputs self.default_dynamic_outputs = default_dynamic_outputs self.function = function + self.custom_output_start_index = 0 class PipelineGraph():