Is it possible programmatically merge/modify command history queue?
I want this really for an UNDO operation: If my script performs a series of commands to create some meshes, what's the best way to "group" my commands together, so that UNDO can clean up the changes?
(In some query languages this is also called a transaction, which can be rollbacked.)
(I understand some commands are not undo-able, so an alternative would be to delete the result instead, but then how do I wire the delete to UNDO??)
Replies
However you can indeed group them, take a look at undoInfo, especially the openChunk parameter : http://download.autodesk.com/global/docs/maya2013/en_us/Commands/undoInfo.html
I don't think I am messing with the history though, so my question is now: what could have caused my undo problem?
For instance: is there a limited length of commands on each undo chunk? (Not the undo history queue length, but how many commands a undo chunk can remember...)
To be precise: pathAnimation is itself can be undo, but any commands before it are no longer undo-able.
EDIT: also some "forced" operations such as connectAttr -lock 1, Maya doesn't know how to go back? so undo is broken.