From c6dfcb66559c57bce19d8ce73259d473583177c7 Mon Sep 17 00:00:00 2001 From: pullusb Date: Wed, 17 Apr 2024 17:03:34 +0200 Subject: [PATCH] Fix output file format problem --- OP_add_layer.py | 2 +- gen_vlayer.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/OP_add_layer.py b/OP_add_layer.py index 5d1def0..0224c00 100644 --- a/OP_add_layer.py +++ b/OP_add_layer.py @@ -135,7 +135,7 @@ class GPEXP_OT_split_to_scene(bpy.types.Operator): if err: self.report({'ERROR'}, err) return {"CANCELLED"} - + elif self.mode == 'INDIVIDUAL': print('split selected object individually in separated scenes') errors = [] diff --git a/gen_vlayer.py b/gen_vlayer.py index 5c8ab2a..2fb5edb 100644 --- a/gen_vlayer.py +++ b/gen_vlayer.py @@ -223,11 +223,11 @@ def connect_render_layer(rlayer, ng=None, out=None, frame=None): if groupout.links and groupout.links[0].to_node.type == 'OUTPUT_FILE': # if already connected to outfile just skip cause user might have customised the name return - - slot_name = f'{lname}/{lname}_' + out_name = f'OUT_{obname}' # or get output from frame if not out: out = nodes.get(out_name) + if not out: # color = (0.2,0.3,0.5) out = fn.create_node('CompositorNodeOutputFile', tree=node_tree, location=(fn.real_loc(ng)[0]+500, fn.real_loc(ng)[1]+50), width=600) # =(ng.location[0]+600, ng.location[1]+50) @@ -240,6 +240,13 @@ def connect_render_layer(rlayer, ng=None, out=None, frame=None): else: out.base_path = f'//render/{out_base}' + if out.format.file_format == 'OPEN_EXR_MULTILAYER': + # Direct name in multilayer + slot_name = lname + else: + # base_path/ named_folder/image_#### + slot_name = f'{lname}/{lname}_' + ## out_input = out.inputs.get(slot_name) # ok for non-numbered outputs out_input = None