The good news is that I whipped up a simple test case, and the undo works as expected. IE:
MEL
global proc doStuff()
{
string $loc[] = `spaceLocator -n "myLocator1"`;
xform -ws -t 0 0 1 $loc[0];
string $loc[] = `spaceLocator -n "myLocator2"`;
xform -ws -t 0 0 2 $loc[0];
string $loc[] = `spaceLocator -n "myLocator3"`;
xform -ws -t 0 0 3 $loc[0];
}
doStuff();
PyMEL
import pymel.core as pm
def doStuffInPyMEL():
loc = pm.spaceLocator(name='myLocator1')
pm.xform(loc, ws=True, t=(0,0,1))
loc = pm.spaceLocator(name='myLocator2')
pm.xform(loc, ws=True, t=(0,0,2))
loc = pm.spaceLocator(name='myLocator3')
pm.xform(loc, ws=True, t=(0,0,3))
doStuffInPyMEL()
That being said… I invested my code even further, and discovered that I cannot seem to be able to undo the following code, executed in a brand new file:
import pymel.core as pm
pm.system.newFile( force=True )
pm.surface( du=1, dv=1, ku=(0, 1), kv=(0, 1), p=( (-1, 1, 0), (-1, -1, 0), (1, 1, 0), (1, -1, 0)))
Any ideas here? Even the example code in the pymel.core.surface documentation seem to fail undo. My expectation is to undo the creation of the nurbs plane back to a blank file.
-csa