rename fields in selection to fileoutput

1.8.0

- added: Allow to rename output on the fly using `connect selection to output`
This commit is contained in:
pullusb
2024-06-24 16:10:44 +02:00
parent 332f8594ea
commit fe3f0ae869
4 changed files with 30 additions and 11 deletions
+12 -4
View File
@@ -1871,7 +1871,7 @@ def recursive_node_connect_check(l, target_node):
return True
return False
def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None, file_format=None):
def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None, remap_names=None, file_format=None):
"""Connect selected nodes output to file output(s)
if a file output is selected, add intputs on it
@@ -1952,7 +1952,12 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None
for o in outs:
if next((l for l in o.links if recursive_node_connect_check(l, fo)), None):
continue
slot_name = bpy.path.clean_name(o.name)
if remap_names and (custom_name := remap_names.get(o.name)):
slot_name = bpy.path.clean_name(custom_name) # clean name ?
else:
slot_name = bpy.path.clean_name(o.name)
# if fo.format.file_format == 'OPEN_EXR_MULTILAYER':
# slot_name = slot_name
# else:
@@ -2010,8 +2015,11 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None
# if next((l for l in o.links if l.to_node == fo), None):
if next((l for l in o.links if recursive_node_connect_check(l, fo)), None):
continue
slot_name = bpy.path.clean_name(o.name) # directly use name in multi layer exr
if remap_names and (custom_name := remap_names.get(o.name)):
slot_name = bpy.path.clean_name(custom_name) # clean name ?
else:
slot_name = bpy.path.clean_name(o.name) # directly use name in multi layer exr
# if fo.format.file_format == 'OPEN_EXR_MULTILAYER':
# slot_name = slot_name