Add preferences with default templates with option to set them from env (falling back to prefs) at startup
change default templates to use label instead of name
This commit is contained in:
@@ -402,7 +402,7 @@ class RT_OT_create_output_layers(bpy.types.Operator):
|
||||
row.prop(self, 'use_base_path_templates')
|
||||
|
||||
if self.use_base_path_templates:
|
||||
row.operator("rt.set_env_settings", text='', icon='FILE_REFRESH')
|
||||
row.operator("rt.reset_path_templates", text='', icon='FILE_REFRESH')
|
||||
row.separator()
|
||||
|
||||
row.operator("rt.info_note", text='', icon='INFO').text = """Format the base path using templates.
|
||||
|
||||
@@ -87,24 +87,24 @@ class RT_OT_info_note(Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
# Not registered yet
|
||||
class RT_set_env_settings(bpy.types.Operator):
|
||||
"""manually reset environnement settings"""
|
||||
bl_idname = "rt.set_env_settings"
|
||||
bl_label = "Reset Templates From Env"
|
||||
bl_description = "Reset Render Toolbox templates from environment variables"
|
||||
class RT_reset_path_templates(bpy.types.Operator):
|
||||
"""manually reset template to preferences or env settings"""
|
||||
bl_idname = "rt.reset_path_templates"
|
||||
bl_label = "Reset Render Toolbox Templates"
|
||||
bl_description = "Reset Render Toolbox templates from preferences or environment variables if applicable"
|
||||
bl_options = {"REGISTER", "UNDO", "INTERNAL"}
|
||||
|
||||
# mode : bpy.props.StringProperty(default='ALL', options={'SKIP_SAVE'}) # 'HIDDEN',
|
||||
|
||||
def execute(self, context):
|
||||
from ..properties import set_env_properties
|
||||
set_env_properties()
|
||||
from ..properties import reset_scene_path_templates
|
||||
reset_scene_path_templates()
|
||||
return {'FINISHED'}
|
||||
|
||||
classes = (
|
||||
RT_OT_select_object_by_name,
|
||||
RT_OT_info_note,
|
||||
RT_set_env_settings,
|
||||
RT_reset_path_templates,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user