-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkspace.py
35 lines (28 loc) · 1.02 KB
/
workspace.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def get_assetbrowser_area(context):
if context.workspace:
for screen in context.workspace.screens:
for area in screen.areas:
if area.type == 'FILE_BROWSER' and area.ui_type == 'ASSETS':
return area
def get_assetbrowser_space(area):
for space in area.spaces:
if space.type == 'FILE_BROWSER':
return space
def get_3dview_area(context):
if context.workspace:
for screen in context.workspace.screens:
for area in screen.areas:
if area.type == 'VIEW_3D':
return area
else:
print("WARNING: context has no workspace attribute")
def get_3dview_space(area):
for space in area.spaces:
if space.type == 'VIEW_3D':
return space
def get_window_region_from_area(area):
for region in area.regions:
if region.type == 'WINDOW':
return region, region.data
def is_fullscreen(screen):
return len(screen.areas) == 1 and 'nonnormal' in screen.name