2012-05-02 13:28:13 +00:00
|
|
|
"""
|
|
|
|
It is also possible to run an operator in a particular part of the user
|
2022-04-20 12:49:13 +10:00
|
|
|
interface. For this we need to pass the window, area and sometimes a region.
|
2012-05-02 13:28:13 +00:00
|
|
|
"""
|
|
|
|
|
2022-04-20 12:49:13 +10:00
|
|
|
# Maximize 3d view in all windows.
|
2012-05-02 13:28:13 +00:00
|
|
|
import bpy
|
2022-04-20 12:49:13 +10:00
|
|
|
from bpy import context
|
2012-05-02 13:28:13 +00:00
|
|
|
|
2022-04-20 12:49:13 +10:00
|
|
|
for window in context.window_manager.windows:
|
2012-05-02 13:28:13 +00:00
|
|
|
screen = window.screen
|
|
|
|
for area in screen.areas:
|
|
|
|
if area.type == 'VIEW_3D':
|
2022-04-20 12:49:13 +10:00
|
|
|
with context.temp_override(window=window, area=area):
|
|
|
|
bpy.ops.screen.screen_full_area()
|
2012-05-02 13:28:13 +00:00
|
|
|
break
|