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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user