Hmm.. it can be done using MDGModifier class (commandToExecute, doIt, undoIt). BUT!!
How can I add this undoIt/doIt to Maya's undo/redo queue? i.e; if we call MDGModifier's doIt() once and then do 3 actions on viewport, then if we press ctrl+z repeatedly, will MDGModifier's undoIt() be called after undoing the 3 actions by any way? How can i map ctrl+z to this undoIt() like this?
Plz help.