fix: use lossless codec for tech and cryptos passes

master
pullusb 2025-04-02 12:35:53 +02:00
parent 7fd7f9ab27
commit 2e4a9a3add
2 changed files with 17 additions and 3 deletions

View File

@ -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": "",

18
fn.py
View File

@ -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)
)