/* begin jf_roundkeys.mel Jean-Francois Fortin -=WHAT IT DOES=- snap a anim curve keys to the closest timeframe -=RETURN=- -=NONE=- -=EXAMPLES=- -=REQUIRES=- -=NONE=- -=UPDATES=- end */ global proc jf_roundkeys() { string $sel[] = `ls -sl`; string $ListKeyable[] = `listAttr -k $sel[0]`; for($attr in $ListKeyable) { float $QueryFrame[] = `keyframe -q -timeChange ($sel[0] + "_" + $attr)`; for($z=0;$z 0 ) { float $roundScale = pow(10,$n); if( $fAr > 0 ) { $r[size($r)] = ( ((float)(int)($fAr * $roundScale + 0.5)) /$roundScale ); } else { $r[size($r)] = ( ((float)(int)($fAr * $roundScale - 0.5)) /$roundScale ); } } else { float $roundScale = pow(10,-$n); if( $fAr > 0 ) { $r[size($r)] = ( ((float)(int)($fAr/$roundScale + 0.5)) *$roundScale ); } else { $r[size($r)] = ( ((float)(int)($fAr/$roundScale - 0.5)) *$roundScale ); } } } return $r; }