diff --git a/__init__.py b/__init__.py index 2ebffbe..e254139 100755 --- a/__init__.py +++ b/__init__.py @@ -2,7 +2,7 @@ bl_info = { "name": "Render Toolbox", "description": "Perform checks and setup outputs", "author": "Samuel Bernou", - "version": (0, 3, 0), + "version": (0, 3, 1), "blender": (3, 0, 0), "location": "View3D", "warning": "", diff --git a/fn.py b/fn.py index 9b6a7dc..1f9b326 100755 --- a/fn.py +++ b/fn.py @@ -187,6 +187,19 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None excludes = excludes or {} remap_names = remap_names or {} + + tech_file_format = file_format.copy() if file_format else None + + if tech_file_format: + ## TODO: Set to EXR if provioded is not ERX or EXR multilayer ? + # ->> if tech_file_format.get('file_format')) is not in ('OPEN_EXR', 'OPEN_EXR_MULTILAYER'): ... + + ## Force 32 bit + tech_file_format['color_depth'] = '32' + ## Enforce a lossless format if provided is not + if (codec := tech_file_format.get('exr_codec')) and codec not in ['ZIP','PIZ','RLE','ZIPS']: + tech_file_format['exr_codec'] = 'PIZ' + for node in node_list: exclusions = excludes.get(node.name) or [] @@ -226,6 +239,7 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None if fo_regular and fo_regular not in created_nodes: created_nodes.append(fo_regular) + y_offset += -22 * len(regular_outputs) - node_margin # Create and connect tech outputs with 32-bit depth if split_tech_passes is True if tech_outputs: @@ -233,7 +247,7 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None fo_tech = create_and_connect_file_output( node, tech_outputs, None, out_name, base_path, - out_base, scene, remap_names, file_format, + out_base, scene, remap_names, tech_file_format, suffix='tech/', color_depth='32', location_offset=(500, y_offset) ) @@ -250,7 +264,7 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None fo_crypto = create_and_connect_file_output( node, crypto_outputs, None, out_name, base_path, - out_base, scene, remap_names, file_format, + out_base, scene, remap_names, tech_file_format, suffix='cryptos/', color_depth='32', location_offset=(500, y_offset) )