Add format customization for splitted tech passes codec (default to ZIP)
This commit is contained in:
@@ -208,7 +208,7 @@ def create_and_connect_file_output(node, outputs, file_out, out_name, base_path,
|
||||
|
||||
|
||||
def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None, remap_names=None,
|
||||
file_format=None, split_tech_passes=False, template=None):
|
||||
file_format=None, split_tech_passes=False, tech_file_format=None, template=None):
|
||||
"""Connect selected nodes output to file output(s)
|
||||
if a file output is selected, add intputs on it
|
||||
|
||||
@@ -248,18 +248,19 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None
|
||||
excludes = excludes or {}
|
||||
remap_names = remap_names or {}
|
||||
|
||||
if tech_file_format is None:
|
||||
## Fallback to file format (then customize) is not provided
|
||||
tech_file_format = file_format.copy() if file_format else None
|
||||
if tech_file_format:
|
||||
# Set to EXR if provided is not exr type e.g PNG
|
||||
if tech_file_format.get('file_format') not in ('OPEN_EXR', 'OPEN_EXR_MULTILAYER'):
|
||||
tech_file_format['file_format'] = 'OPEN_EXR'
|
||||
|
||||
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'] = 'ZIP'
|
||||
## 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'] = 'ZIP'
|
||||
|
||||
for node in node_list:
|
||||
exclusions = excludes.get(node.name) or []
|
||||
|
||||
Reference in New Issue
Block a user