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:
pullusb
2023-01-17 16:50:42 +01:00
parent 544cd7bf56
commit f3646e37df
9 changed files with 75 additions and 22 deletions
+25 -1
View File
@@ -92,6 +92,31 @@ def create_aa_nodegroup(tree):
## -- object and scene settings
def activate_workspace(name='', context=None):
if not name:
return
if context is None:
context = bpy.context
if context.window.workspace.name == name:
print(f'Already in {name} workspace')
return
if (wkspace := bpy.data.workspaces.get(name)):
context.window.workspace = wkspace
return True
# Same name with spaces as underscore
dir_name = name.replace(' ', '_')
filepath = Path(__file__).parent / 'app_templates' / dir_name / 'startup.blend'
ret = bpy.ops.workspace.append_activate(idname=name, filepath=str(filepath))
if ret != {'FINISHED'}:
print(f'Could not found {name} at {filepath}')
return False
return context.window.workspace
def copy_settings(obj_a, obj_b):
exclusion = ['bl_rna', 'id_data', 'identifier','name_property','rna_type','properties', 'stamp_note_text','use_stamp_note',
'settingsFilePath', 'settingsStamp', 'select', 'matrix_local', 'matrix_parent_inverse',
@@ -706,7 +731,6 @@ def clean_nodegroup_inputs(ng, skip_existing_pass=True):
# a render layer of this name still exists
continue
ngroup.inputs.remove(ngroup.inputs[i])
# clear_nodegroup_content_if_disconnected(ngroup)
def bridge_reconnect_nodegroup(ng, socket_name=None):