Thursday, January 31, 2013

TDs to the rescue

If you've ever opened up maya and had reference errors and no animation in your scene, grab your keyable nodes and try this (in a python window). Mark's script and blog post can be found here:

 import maya.cmds as cmds,l=True) 
#Change this to False if the curves are not in the rootNamespace but 
#in the sameNamespace as the controllers. 
#build up the main lists'animCurve',s=True) 
[chns.extend(cmds.listAnimatable(node)) for node in nodes]     
for chn in chns: 
    if stripNamespace: 
    if animCurveExpected in animCurves: 
        if not cmds.isConnected('%s.output' % animCurveExpected,chn): 
            print '%s >> %s' % (animCurveExpected,chn) 
            cmds.connectAttr('%s.output' % animCurveExpected,chn,force=True)

No comments: