mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
parent
ecabdd1903
commit
ff0f71d96e
1 changed files with 24 additions and 0 deletions
24
doc/python_api/examples/bpy.ops.4.py
Normal file
24
doc/python_api/examples/bpy.ops.4.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
"""
|
||||
.. _operator-undo:
|
||||
|
||||
Undo
|
||||
----
|
||||
|
||||
The optional second positional argument is a boolean that controls whether the
|
||||
operator call is pushed onto the undo stack.
|
||||
|
||||
It defaults to ``False``, so operators run from a script do not add to the undo
|
||||
history. Pass ``True`` when you want the call to be undoable, for instance when
|
||||
a script performs an edit the user should be able to undo interactively.
|
||||
|
||||
If this call happens while nested inside another operator call, the argument
|
||||
has no effect: the outer call already suppresses undo for everything nested
|
||||
inside it, and that only lifts once the outer call returns.
|
||||
|
||||
Like the execution context this argument is optional, but the positional order
|
||||
must be kept, so the execution context is given first.
|
||||
"""
|
||||
|
||||
# Add a cube as an undoable operator call.
|
||||
import bpy
|
||||
bpy.ops.mesh.primitive_cube_add('EXEC_DEFAULT', True)
|
||||
Loading…
Add table
Add a link
Reference in a new issue