mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
PyAPI: remove context override argument from bpy.ops
Remove deprecated context override argument to operator execution and poll() method in favor of context.temp_override().
This commit is contained in:
parent
ab5fc46872
commit
ac263a9bce
8 changed files with 79 additions and 164 deletions
|
|
@ -20,7 +20,7 @@ you would pass ``{'active_object': object}`` to :class:`bpy.types.Context.temp_o
|
|||
# Remove all objects in scene rather than the selected ones.
|
||||
import bpy
|
||||
from bpy import context
|
||||
override = context.copy()
|
||||
override["selected_objects"] = list(context.scene.objects)
|
||||
with context.temp_override(**override):
|
||||
context_override = context.copy()
|
||||
context_override["selected_objects"] = list(context.scene.objects)
|
||||
with context.temp_override(**context_override):
|
||||
bpy.ops.object.delete()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue