add env variable and prefs for tech passes split, and allow customization ofr tech passes split in popup
This commit is contained in:
@@ -7,6 +7,9 @@ from .constant import TECH_PASS_KEYWORDS
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def get_addon_prefs():
|
||||
return bpy.context.preferences.addons[__package__].preferences
|
||||
|
||||
# region Manage nodes
|
||||
|
||||
def real_loc(n):
|
||||
@@ -208,7 +211,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, tech_file_format=None, template=None):
|
||||
file_format=None, tech_pass_names=None, tech_file_format=None, template=None):
|
||||
"""Connect selected nodes output to file output(s)
|
||||
if a file output is selected, add intputs on it
|
||||
|
||||
@@ -230,8 +233,12 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None
|
||||
|
||||
remap_names (dict, optionnal): List of output names to remap {node_name: {output_name: new_name}}.
|
||||
|
||||
split_tech_passes (bool, optional): When True, create a separate file output for technical passes
|
||||
Defaults to False.
|
||||
tech_pass_names (list[str], optional): list of of socket names to set as separate file output for technical passes
|
||||
Defaults to None
|
||||
|
||||
tech_file_format (dict, optionnal): converts each dictionary key into a file output format for tech passes
|
||||
if not passed, will use file_format.
|
||||
Defaults to None.
|
||||
|
||||
Returns:
|
||||
list[bpy.types.CompositorNode]: All nodes created.
|
||||
@@ -278,9 +285,9 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None
|
||||
# Categorize outputs
|
||||
crypto_outputs = [o for o in all_outputs if 'crypto' in o.name.lower()]
|
||||
|
||||
if split_tech_passes:
|
||||
if tech_pass_names:
|
||||
# Filter tech passes
|
||||
tech_outputs = [o for o in all_outputs if o.name.lower() in TECH_PASS_KEYWORDS] # any(keyword in o.name.lower() for keyword in TECH_PASS_KEYWORDS)]
|
||||
tech_outputs = [o for o in all_outputs if o.name.lower() in tech_pass_names] # TECH_PASS_KEYWORDS
|
||||
# Regular outputs (excluding crypto and tech passes)
|
||||
regular_outputs = [o for o in all_outputs if o not in crypto_outputs and o not in tech_outputs]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user