I am still finding my feet in Maya, on my project, some files have grown to 800mb in size. Things get corrupt, hand editing MAs is common; I am really learning some of the internals.
In the past week I have had to do a lot of timeline walking to switch coord spaces and get baked animations into and out of hierarchies. In 3dsMax you can do a loop and evaluate a node ‘at time i’, and there is no redraw or anything. I didn’t know how to do this in Maya.
I previously did this with looping cmds.currentTime(i) and ‘walking the timeline’, however, you can set the time node directly like so: cmds.setAttr(“time1.outTime”, int(i))
Unparenting a child with keyed compensation (1200 frames)
10.0299999714 sec – currentTime
2.02 sec – setAttr
There are some caveats, whereas in a currentTime loop you can just cmds.setKeyframe(node), I now have to cmds.setKeyframe(node, time=i). But when grabbing a matrix, I don’t need to pass time and it works, I don’t think you can anyway.. I guess it gets time from the time node.
Here’s a sample loop that makes a locator and copies a nodes animation to world space:
#function feeds in start, end, node if not start: start = cmds.playbackOptions(minTime=1, q=1) if not end: end = cmds.playbackOptions(maxTime=1, q=1) loc = cmds.spaceLocator(name='parentAlignHelper') for i in range(start, (end+1)): cmds.setAttr("time1.outTime", int(i)) matrix = cmds.xform(node, q=1, ws=1, m=1) cmds.xform(loc, ws=1, m=matrix) cmds.setKeyframe(loc, time=i)