Hey guys, In blender 2.79 I could edit a layout’s areas through code and by layout name (without having them active):
for area in bpy.data.screens["Animation"].areas:
if area.type == 'VIEW_3D':
for spaces in area.spaces:
if spaces.type == 'VIEW_3D':
area.spaces.active.clip_start = 0.1
However I don’t know how to access workspace areas in 2.80
Any help?
Thank you so much, saved me a sleepless night there haha.
This works but i’m just putting it here in case someone needs it or if someone points out I made a mistake:
for area in bpy.data.workspaces['my_workspace'].screens[0].areas:
if area.type == 'VIEW_3D':
for spaces in area.spaces:
if spaces.type == 'VIEW_3D':
area.spaces.active.clip_start = 0.1
Using the code which worked i now get this error. RuntimeError: class SCREEN_OT_set_layout, function execute: incompatible return value , str(, Function.result expected a set, not a NoneType)
No matter how i change the code the output error is always the same. I tried this using info given earlier
Okay after lots of fiddling i got it to work again
I know use this line and am able to switch workspaces again with the menu and shortcuts bpy.context.window.workspace = bpy.data.workspaces[self.layoutItems1]