diff options
Diffstat (limited to 'doc/python_api/examples/bpy.ops.3.py')
-rw-r--r-- | doc/python_api/examples/bpy.ops.3.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/python_api/examples/bpy.ops.3.py b/doc/python_api/examples/bpy.ops.3.py new file mode 100644 index 00000000000..0b5bcafe5be --- /dev/null +++ b/doc/python_api/examples/bpy.ops.3.py @@ -0,0 +1,18 @@ +""" +It is also possible to run an operator in a particular part of the user +interface. For this we need to pass the window, screen, area and sometimes +a region. +""" + +# maximize 3d view in all windows +import bpy + +for window in bpy.context.window_manager.windows: + screen = window.screen + + for area in screen.areas: + if area.type == 'VIEW_3D': + override = {'window': window, 'screen': screen, 'area': area} + bpy.ops.screen.screen_full_area(override) + break + |