undo function with api


#1

Hello,

i am working with the maya api. I normally use python and so can undo the scripts i run. But how do you do this with the api. it doesn’t respond to ctrl z

does anyone know how to do this?

thanks,
Sam


#2

Only commands are automatically undone, because they already implement undo callbacks.
If you operate on the graph or its contents through the API then it can’t be automatically undone because there is nothing on the stack. You have to implement things as a command, register it, and properly implement doit, undoit and redoit callbacks yourself.