Keyframed animation convert to driven key anim...?

is there a script to take existing keyframe animation, and covert it to a driven-key animation?

rather than manually picking and driven-keying all joints and creating an animation that way, it would use the keyframes you have created and convert the whole animation to be driven by an attribute beteen 0 and 1.

ie: i have a simple looped walking bug, keyframed it out to loop between frames 0 and 30, and now want the loop to be driven by a single locator keyed betweeen 0 and 1 on pX. i have multiple walk cycles already made and don't want to waste time by redoing the animation to make it a driven key based animation... the main reason i need this rather than using trax is that i want the bug to walk along a path at a correct rate...

thanks for any help y'all

No biggie just connect a custom time to the anim curves input (infact a sdk is just a anim curve), you can do a mel loop and connect all anim curves to this cutom time or attribute

Brief demo (paste in new empty scene)

{//protected block
//lets create some anim
sphere -p 0 0 0 -ax 0 1 0 -ssw 0 -esw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -nsp 4 -ch 1;
setKeyframe -breakdown 0 -hierarchy none -controlPoints 0 -shape 0 {"nurbsSphere1"};
currentTime 40 ;
move -r -1 2 1;
rotate -r -os -10 0 10;
setKeyframe -breakdown 0 -hierarchy none -controlPoints 0 -shape 0 {"nurbsSphere1"};
currentTime 80 ;
move -r 1 -2 3 ;
rotate -r -os -10 0 0;
setKeyframe -breakdown 0 -hierarchy none -controlPoints 0 -shape 0 {"nurbsSphere1"};
//lets get the connected anim curves
$curves=listConnections -type animCurve nurbsSphere1;
//add driving attribute
addAttr -ln customTime -at double -min 0 -max 1 |nurbsSphere1;
setAttr -e -keyable true |nurbsSphere1.customTime;
//normalize time (one could also scale the curves!)
createNode multiplyDivide;
connectAttr -f nurbsSphere1.customTime multiplyDivide1.input1X;
setAttr "multiplyDivide1.input2X" 80;
//connect normalized time to curves
for ($curve in $curves)
connectAttr -f multiplyDivide1.outputX ($curve +".input");
//select the sphere
select -r nurbsSphere1 ;
}
And manipulate the custom time!

interesting.... i am not a very good scripter, but i see whats going on there, how would i use this on lets say a bunch of joints? and if the custom time is always changing (connected to U value of a curve)...

i wrote something that uses get attribute, a duplicate rig looks at my keyframed one, matches it and then sets the driven keys and so on for a frame range... looks like this:

//Keys to Drive
//
// KeysToDrive(firstframe,lastframe);
//
//

global proc KeysToDrive(int $start, int $end){

int $i;
for($i=$start; $i<$end; $i++){

	currentTime -e $i;

// crab_base

float $tx = getAttr "X\_crab\_base.tx";
setAttr "crab_base.tx" $tx;
float $ty = getAttr "X\_crab\_base.ty";
etc....

select -r crab ;

setDrivenKeyframe -cd crab.walkCycle crab_clawend_Lt.translateX;
setDrivenKeyframe -cd crab.walkCycle crab_clawend_Lt.translateY;
setDrivenKeyframe -cd crab.walkCycle crab_clawend_Lt.translateZ;
setDrivenKeyframe -cd crab.walkCycle crab_clawend_Lt.rotateX;
etc...

it works!

thanks for your advice ...