There are a few HUGE expectations here, mainly that the scene is clean and that the animCurves are still consistently named against the channel they were keyed against. As I said, this is a hack but it seems to be what a lot of people are in need of.
So the expectation is that an attr on a controller called NameSpace:L_Foot.translateX should be connected to NameSpace:L_Foot_translateX, or L_Foot_translateX depending on the flag stripNamespace thats in the code.
As I said, this is a really quick hack, but I figured what the hell. Oh and if the data went through AnimLayers....sorry, you're stuffed!
import maya.cmds as cmds nodes=cmds.ls(sl=True,l=True) chns= #Change this to False if the curves are not in the rootNamespace but #in the sameNamespace as the controllers. stripNamespace=True #build up the main lists animCurves=cmds.ls(type='animCurve',s=True) [chns.extend(cmds.listAnimatable(node)) for node in nodes] for chn in chns: if stripNamespace: animCurveExpected=chn.split(':')[-1].split('|')[-1].replace('.','_') else: animCurveExpected=chn.split('|')[-1].replace('.','_') 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)