Undo Class
A class to enable and disable undo functionality. Undo blocks can be created during python callbacks. At the end of callbacks, any dangling undo blocks will be terminated.
Members
globalState
→ bool
:
Is global undo enabled or not.
redoStack
→ list
(Read Only):
A list of names for redo operations available.
state
→ bool
(Read Only):
Is undo enabled or not.
undoStack
→ list
(Read Only):
A list of names for undo operations available.
Methods
startBlock(name, enable=True)
→ None
:
Start a named undo block.
clear()
→ None
:
Clear undo and redo stack. This will terminate any current undo blocks.
addCallback(callback, info=None)
→ None
:
Add a Python callback into the undo block
- callback - user defined callback in the form of
callback(isUndo, info)
- info - this argument will be passed back to user in the callback
redo()
→ None
:
Redo the next operation. This will terminate any current undo blocks.
undo()
→ None
:
Undo the last operation. This will terminate any current undo blocks.
endBlock()
→ None
:
Terminate an undo block.
TouchDesigner Build: