Go to: Synopsis. Return value. Related. Flags. Python examples.

Synopsis

undoInfo([chunkName=string], [closeChunk=boolean], [infinity=boolean], [length=uint], [openChunk=boolean], [printQueue=boolean], [printRedoQueue=boolean], [redoName=string], [redoQueueEmpty=boolean], [state=boolean], [stateWithoutFlush=boolean], [undoName=string], [undoQueueEmpty=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

undoInfo is undoable, queryable, and NOT editable.

This command controls the undo/redo parameters.

In query mode, if invoked without flags (other than the query flag), this command will return the number of items currently on the undo queue.

Return value

stringIf querying undoName or redoName
intIf querying state, infinity, or length

In query mode, return type is based on queried flag.

Related

flushUndo, redo, undo

Flags

chunkName, closeChunk, infinity, length, openChunk, printQueue, printRedoQueue, redoName, redoQueueEmpty, state, stateWithoutFlush, undoName, undoQueueEmpty
Long name (short name) Argument types Properties
chunkName(cn) string createquery
Sets the name used to identify a chunk for undo/redo purposes when opening a chunk.
closeChunk(cck) boolean create
Closes the chunk that was opened earlier by openChunk. Once close chunk is called, all undoable operations in the chunk will undo as a single undo operation. Use with CAUTION!! Improper use of this command can leave the undo queue in a bad state.
infinity(infinity) boolean createquery
Set the queue length to infinity.
length(l) uint createquery
Specifies the maximum number of items in the undo queue. The infinity flag overrides this one.
openChunk(ock) boolean create
Opens a chunk so that all undoable operations after this call will fall into the newly opened chunk, until close chunk is called. Once close chunk is called, all undoable operations in the chunk will undo as a single undo operation. Use with CAUTION!! Improper use of this command can leave the undo queue in a bad state.
printQueue(pq) boolean query
Prints to the Script Editor the contents of the undo queue.
printRedoQueue(prq) boolean query
Prints to the Script Editor the contents of the redo queue.
redoName(rn) string query
Returns what will be redone (if anything)
redoQueueEmpty(rqe) boolean query
Return true if the redo queue is empty. Return false if there is at least one command in the queue to be redone.
state(st) boolean createquery
Turns undo/redo on or off.
stateWithoutFlush(swf) boolean createquery
Turns undo/redo on or off without flushing the queue. Use with CAUTION!! Note that if you perform destructive operations while stateWithoutFlush is disabled, and you then enable it again, subsequent undo operations that try to go past the destructive operations may be unstable since undo will not be able to properly reconstruct the former state of the scene.
undoName(un) string query
Returns what will be undone (if anything)
undoQueueEmpty(uqe) boolean query
Return true if the undo queue is empty. Return false if there is at least one command in the queue to be undone.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Turn undo on, with an infinite queue length
cmds.undoInfo( state=True, infinity=True )
# Turn undo on, with a queue length of 200
cmds.undoInfo( state=True, infinity=False, length=200 )
# Turn undo off
cmds.undoInfo( state=False )
# Query the queue length
cmds.undoInfo( q=True, length=True )
# Query the number of items currently on the queue.
cmds.undoInfo( q=True )