Improve connect to file output feature with better name besed on source socket and node
1.8.13
1.8.13
- changed: improve `connect to fileoutput` feature:
- possible to choose `node_name + socket name` or `node name` instead of `socket name` only
- default is now `node_name_socket_name`
- added some exception behavior:
- if a node has single output : write the node name only
- render layers use `scene_viewlayer` as node_name intead of "Render Layer"
- interface shows source node label (with source node name in parenthesis)
- interface shows render layer scene/viewlayer name (with name in parenthesis)
This commit is contained in:
@@ -1906,6 +1906,9 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None
|
||||
|
||||
excludes (dict, optionnal): List of output names to exclude {node_name: [outputs,]}.
|
||||
Defaults toNone.
|
||||
|
||||
remap_names (dict, optionnal): List of output names to remap {node_name: {output_name: new_name}}.
|
||||
|
||||
frame (bpy.types.CompositorNode, optional): If given, create nodes into a frame.
|
||||
Defaults to None.
|
||||
|
||||
@@ -1969,7 +1972,7 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None
|
||||
if next((l for l in o.links if recursive_node_connect_check(l, fo)), None):
|
||||
continue
|
||||
|
||||
if remap_names and (custom_name := remap_names.get(o.name)):
|
||||
if (socket_remaps := remap_names.get(node.name)) and (custom_name := socket_remaps.get(o.name)):
|
||||
slot_name = bpy.path.clean_name(custom_name) # clean name ?
|
||||
else:
|
||||
slot_name = bpy.path.clean_name(o.name)
|
||||
@@ -2032,7 +2035,8 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None
|
||||
if next((l for l in o.links if recursive_node_connect_check(l, fo)), None):
|
||||
continue
|
||||
|
||||
if remap_names and (custom_name := remap_names.get(o.name)):
|
||||
# if remap_names and (custom_name := remap_names.get(o.name)):
|
||||
if (socket_remaps := remap_names.get(node.name)) and (custom_name := socket_remaps.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
|
||||
|
||||
Reference in New Issue
Block a user