Append GP render workspace from dopepsheet panel
1.2.1 - added: bundle app_template to load "GR Render" workspace from it - added: ui button in dopesheet to load GP render workspace
This commit is contained in:
+4
-17
@@ -241,24 +241,11 @@ class GPEXP_OT_render_auto_build(bpy.types.Operator):
|
||||
if (render_wkspace := bpy.data.workspaces.get('GP Render')):
|
||||
context.window.workspace = render_wkspace
|
||||
else:
|
||||
render_wkspace_filepath = Path(bpy.utils.user_resource('SCRIPTS'), 'startup', 'bl_app_templates_user', 'GP', 'startup.blend')
|
||||
ret = bpy.ops.workspace.append_activate(idname='GP Render', filepath=str(render_wkspace_filepath))
|
||||
|
||||
if ret != {'FINISHED'}:
|
||||
print(f'Fallback to addon stored workspaces: (No "GP Render" found in {render_wkspace_filepath})')
|
||||
# Fallback to workspace template shipped with addon (TODO : add template blend file in addon)
|
||||
render_wkspace_filepath = Path(__file__).parent / 'workspaces' / 'startup.blend'
|
||||
ret = bpy.ops.workspace.append_activate(idname='GP Render', filepath=str(render_wkspace_filepath))
|
||||
|
||||
if ret != {'FINISHED'}:
|
||||
ret = fn.activate_workspace('GP Render')
|
||||
# render_wkspace_filepath = Path(__file__).parent / 'app_templates' / 'GP_render' / 'startup.blend'
|
||||
# ret = bpy.ops.workspace.append_activate(idname='GP Render', filepath=str(render_wkspace_filepath))
|
||||
if not ret:
|
||||
print('No GP render workspace available')
|
||||
|
||||
## extra retry after append activate ?...
|
||||
if ret == {'FINISHED'}:
|
||||
render_wkspace = bpy.data.workspaces.get('GP Render')
|
||||
if render_wkspace:
|
||||
context.window.workspace = render_wkspace
|
||||
|
||||
|
||||
# context.workspace.update_tag()
|
||||
# context.scene.update_tag()
|
||||
|
||||
Reference in New Issue
Block a user