add template in create output path base node
templates for slot are in code but disabled, not useful in the end
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
import bpy
|
||||
import os
|
||||
|
||||
from bpy.types import PropertyGroup
|
||||
from bpy.props import StringProperty
|
||||
|
||||
|
||||
class RT_PG_render_toolbox_props(PropertyGroup):
|
||||
default_base_path : StringProperty(
|
||||
name="Base Path Template",
|
||||
description="Template for file output base path\
|
||||
\nFolder containing subsequent filepath",
|
||||
default="//render/{node_name}/",
|
||||
# options={'SKIP_SAVE'}
|
||||
)
|
||||
|
||||
## Multilayer base path : output on file instead of folder
|
||||
default_multilayer_base_path : StringProperty(
|
||||
name="Base Path Template",
|
||||
description="Template for multilayer file output base paths\
|
||||
\nOutput of the file sequence",
|
||||
default="//render/{node_name}/{node_name}_",
|
||||
# options={'SKIP_SAVE'}
|
||||
)
|
||||
|
||||
### file slots (not used currently)
|
||||
|
||||
default_file_slot : StringProperty(
|
||||
name="File Slot Template",
|
||||
description="Template for file output file slots\
|
||||
\nSubpath added to base path for file sequence",
|
||||
default="{socket_name}/{socket_name}_",
|
||||
# options={'SKIP_SAVE'}
|
||||
)
|
||||
|
||||
## Multilayer's layer: layer name in EXR instead of subpath to file
|
||||
default_multilayer_name : StringProperty(
|
||||
name="Layer Name Template",
|
||||
description="Template for multilayer file output layer names\
|
||||
\nLayer name in EXR multilayer file",
|
||||
default="{socket_name}",
|
||||
# options={'SKIP_SAVE'}
|
||||
)
|
||||
|
||||
# default_tech_pass_name : StringProperty(
|
||||
# name="Tech Pass Name Template",
|
||||
# description="Template for tech pass file output layer names\
|
||||
# \nLayer name in EXR multilayer file",
|
||||
# default="tech",
|
||||
# # options={'SKIP_SAVE'}
|
||||
# )
|
||||
|
||||
# default_crypto_name : StringProperty(
|
||||
# name="Crypto Pass Name Template",
|
||||
# description="Template for crypto pass file output layer names\
|
||||
# \nLayer name in EXR multilayer file",
|
||||
# default="crypto",
|
||||
# # options={'SKIP_SAVE'}
|
||||
# )
|
||||
|
||||
def set_env_properties():
|
||||
## set default template from environment variable if available
|
||||
exr_base_path_template = os.getenv('RENDERTOOLBOX_EXR_PATH_TEMPLATE')
|
||||
if exr_base_path_template:
|
||||
bpy.context.scene.render_toolbox.default_base_path = exr_base_path_template
|
||||
|
||||
multilayer_base_path_template = os.getenv('RENDERTOOLBOX_MULTILAYER_PATH_TEMPLATE')
|
||||
if multilayer_base_path_template:
|
||||
bpy.context.scene.render_toolbox.default_multilayer_base_path = multilayer_base_path_template
|
||||
|
||||
classes = (
|
||||
RT_PG_render_toolbox_props,
|
||||
)
|
||||
|
||||
def register():
|
||||
for cls in classes:
|
||||
bpy.utils.register_class(cls)
|
||||
|
||||
bpy.types.Scene.render_toolbox = bpy.props.PointerProperty(type=RT_PG_render_toolbox_props)
|
||||
set_env_properties()
|
||||
|
||||
def unregister():
|
||||
del bpy.types.Scene.render_toolbox
|
||||
|
||||
for cls in reversed(classes):
|
||||
bpy.utils.unregister_class(cls)
|
||||
Reference in New Issue
Block a user