Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2022-04-25 11:11:55 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-04-25 11:11:55 +0300
commitd3b5ab37772aafd6892466a61eb75741f70189de (patch)
treefd5a4c1b0a76313ddee5b2a1fa93a7b6f618cd85 /doc/python_api/examples/bpy.ops.3.py
parent99dfc769f32a53c118692451d38d534bed697e88 (diff)
parent416ef3b6b2d21a2eb7a24183ab67c8a540f79d57 (diff)
Merge branch 'master' into temp-gp-overlay-refactortemp-gp-overlay-refactor
Diffstat (limited to 'doc/python_api/examples/bpy.ops.3.py')
-rw-r--r--doc/python_api/examples/bpy.ops.3.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/doc/python_api/examples/bpy.ops.3.py b/doc/python_api/examples/bpy.ops.3.py
index 7dec69cf566..e068ab0c0cf 100644
--- a/doc/python_api/examples/bpy.ops.3.py
+++ b/doc/python_api/examples/bpy.ops.3.py
@@ -1,17 +1,16 @@
"""
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.
+interface. For this we need to pass the window, area and sometimes a region.
"""
-# maximize 3d view in all windows
+# Maximize 3d view in all windows.
import bpy
+from bpy import context
-for window in bpy.context.window_manager.windows:
+for window in 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)
+ with context.temp_override(window=window, area=area):
+ bpy.ops.screen.screen_full_area()
break