Contains the undo engine allowing to adjust the scene with api commands while
providing full undo and redo support.
Configuration
To globally disable the undo queue using cmds.undo will disable tracking of opeartions, but will
still call the mel command.
Disable the 'undoable' decorator effectively remove the surrounding mel script calls
by setting the MRV_UNDO_ENABLED environment variable to 0 (default 1).
Additionally it will turn off the maya undo queue as a convenience.
If the mrv undo queue is disabled, MPlugs will not store undo information anymore
and do not incur any overhead.
|
UndoCmd
|
|
MuteUndo
Instantiate this class to disable the maya undo queue - on deletion, the
previous state will be restored
|
|
StartUndo
Utility class that will push the undo stack on __init__ and pop it on __del__
|
|
UndoRecorder
Utility class allowing to undo and redo operations on the python command
stack so far to be undone and redone separately and independently of maya's
undo queue.
|
|
Operation
Simple command class as base for all operations
All undoable/redoable operation must support it
|
|
GenericOperation
Simple oeration allowing to use a generic doit and untoit call to be accessed
using the operation interface.
|
|
GenericOperationStack
Operation able to undo generic callable commands (one or multiple).
|
|
DGModifier
Undo-aware DG Modifier - using it will automatically put it onto the API undo queue
|
|
DagModifier
undo-aware DAG modifier, copying all extra functions from DGModifier
|
|
|
|
|
|
|
|
_incrStack()
Indicate that a new method level was reached |
source code
|
|
|
_decrStack(name="unnamed")
Indicate that a method level was exitted - and cause the
undo queue to be stored on the command if appropriate
We try to call the command only if needed |
source code
|
|
|
|
|
|
|
|
|
undoable(func)
Decorator wrapping func so that it will start undo when it begins and end undo
when it ends. |
source code
|
|
|
|
|
notundoable(func)
Decorator wrapping a function into a muteUndo call, thus all undoable operations
called from this method will not enter the UndoRecorder and thus pollute it. |
source code
|
|