Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Keyframe Display Issue

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
PParker7
614 Views, 5 Replies

Keyframe Display Issue

Hi, How do I make the keyframes to show on the actual frame? It seems they are all over the place, I need them placed exactly on the the number, now it shows as if there are in between half frames etc which makes it very difficult to move or select. Do I need to change something in the settings? Please advice.

 

de.png

5 REPLIES 5
Message 2 of 6
PParker7
in reply to: PParker7

Also to mention that the issue originates from the fact that somewhere along the project I accidentally converted the scene from 24fps to 30fps without keeping the frames at position, and now I have all these in between frames which I cannot control and its very frustrating. Is there a way to get the frames back to normal, please help. Thank You

Message 3 of 6
hamsterHamster
in reply to: PParker7

What comes to mind is either you move all the keyframes in the GraphEditor/DopeSheet sideways forth-back with the TimeSnap option enabled, and correct some keys that jumped to the same frame (the animation slightly alters ) OR do Edit>Keys>Bake Simulation (you'll have the same animation with bunch of keys and those decimal frame keys, which you can partially fix with SmartBake). Both ways involve the manual intervention.


,,,_°(O__O)°_,,,
Maya2019.1 @ Windows10 & GeForce GTX1080Ti

If the post was helpful, click the
 ACCEPT SOLUTION  button, so others might find it much more easily.

Message 4 of 6
PParker7
in reply to: hamsterHamster

Hi and thank you for your reply, what you proposed works but as you said will require manual work, I found this script which I think does the job as it moves the keyframes to whole frames.

 

{ // get all selected anim curves or anim curves attached to the selection string $animCurves[] = `keyframe -q -name`; for ($animCurve in $animCurves) // browse them { // get all selected keys at this curve float $thisKeys[] = `keyframe -q -sl $animCurve`; if (!size($thisKeys)) // if no keys selected get all keys $thisKeys = `keyframe -q $animCurve`; for ($keys in $thisKeys) // browse the keys { if (`fmod $keys 1` != 0) // if the keys have decimal places move them to the rounded keytime keyframe -e -t $keys -iub true -a -o over -timeChange (floor($keys)) $animCurve; } } }

Message 5 of 6
hamsterHamster
in reply to: PParker7

Ok, as I read from code, it moves all keys backwards, even those that are .99, so you will have a slight animation change. It is the same as I described in the first method, you still need to select animcurves.

Later today I might rewrite this script so it moves keys to the nearest frame.


,,,_°(O__O)°_,,,
Maya2019.1 @ Windows10 & GeForce GTX1080Ti

If the post was helpful, click the
 ACCEPT SOLUTION  button, so others might find it much more easily.

Message 6 of 6
hamsterHamster
in reply to: PParker7

This makes the key approximation more precise.

 

// The script rounds the key times of selected curves/keys to a nearest integer frame.
// get all selected anim curves or anim curves attached to the selection
string $animCurves[] = `keyframe -q -name`;
for ($animCurve in $animCurves) // browse them
    { // get all selected keys at this curve
    float $thisKeys[] = `keyframe -q -sl $animCurve`;
    if (!size($thisKeys)) // if no keys selected get all keys
        $thisKeys = `keyframe -q $animCurve`;
    for ($keys in $thisKeys) // browse the keys
        {
        if (`fmod $keys 1` != 0) // if the keys have decimal places move them to the rounded keytime
            {
            if (`fmod $keys 1` <= 0.5)
                keyframe -e -t $keys -iub true -a -o over -timeChange (floor($keys)) $animCurve;
            else keyframe -e -t $keys -iub true -a -o over -timeChange (ceil($keys)) $animCurve;
        }
    }
}

 

Have fun


,,,_°(O__O)°_,,,
Maya2019.1 @ Windows10 & GeForce GTX1080Ti

If the post was helpful, click the
 ACCEPT SOLUTION  button, so others might find it much more easily.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report