OpenMaya and undo/redo

I have a function in python that sets a bunch of vertex normals. However if i wrap this in a undoInfo chunk and close it, only the cmds stuff gets undone, the vertex normals are untouched by the undo.

Is there a separate path I need to take when using OpenMaya commands?

I think you’ll have to write it as a command plugin so that the API methods will undo properly. An SDK example using the correct methods would be “C:\Program Files\Autodesk\Maya2012\devkit\plug-ins\scripted\blindDoubleDataCmd.py”. Looks like you have to implement the redoIt, undoIt, and isUndoable methods.

I had briefly looked at the command stuff, but was hoping for a quicker route :slight_smile: Thanks for the link!