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

bpy.types.Context.temp_override.3.py « examples « python_api « doc - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e670bb7bafaff26d258d135ac3dbefb94ecf1518 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""
This example shows how it's possible to add an object to the scene in another window.
"""
import bpy
from bpy import context

win_active = context.window
win_other = None
for win_iter in context.window_manager.windows:
    if win_iter != win_active:
        win_other = win_iter
        break

# Add cube in the other window.
with context.temp_override(window=win_other):
    bpy.ops.mesh.primitive_cube_add()