proc keyConsAttrib(string $inputObjs[], string $attributes[], float $startTime, float $endTime, float $inc) { float $curTime = currentTime("-q"); for($eachObj in $inputObjs) { currentTime($startTime); for($eachAttr in $attributes) { string $fullAttr = ($eachObj + "." + $eachAttr); string $listConnResult[] = listConnections("-s", 1, $fullAttr); if(nodeType($listConnResult[0]) != "pairBlend") { setKeyframe($fullAttr); $listConnResult = listConnections("-s", 1, $fullAttr); } string $pairBlend = $listConnResult[0]; $listConnResult = listConnections("-s", 1, "-p", 1, ($pairBlend + ".weight")); string $weightSource = $listConnResult[0]; setAttr($weightSource, 1); } } currentTime($curTime); for($curTime = $startTime; $curTime <= $endTime; $curTime += $inc) { for($eachObj in $inputObjs) { for($eachAttr in $attributes) { string $fullAttr = ($eachObj + "." + $eachAttr); float $value = getAttr("-time", $curTime, $fullAttr); setKeyframe -time $curTime -value $value $fullAttr; } } } } // Usage //keyConsAttrib(ls("-selection", "-long"), {"tx","ty","tz","rx","ry","rz"}, 0, 30, 1);