Undoable commands

Any command that manipulates the state of the Dependency Graph and its nodes, including the DAG, should implement MPxCommand::undoIt() and MPxCommand::isUndoable(),

undoIt() reverses the manipulations that were performed in redoIt().

isUndoable() indicates whether a command's actions can be undone and should be added to Maya's undo queue. It returns true if the command can be undone, and false otherwise. By default it returns false. You will need to override it in your command to return true if the command is is undoable

Important: Only commands that query the scene or do not modify it in any way should be non-undoable. If you create a non-undoable command that modifies the scene, it will break Maya's undo capability.