Color Coding your Keys in Maya

I like to color code my key’s and inbetween key’s when animating in Maya. However, I do not like using Maya’s default between keys. Why? because whenever you place in a between key in maya it will move and slide around when adjusting keys around it. Below are two examples of the problem. The red ticks are keys and the green is an in-between.


Afters sliding the right key over one:

As you can see the green tick slides into an gross position. It isn’t on an actual frame. To prevent this from happening you have to do a little mel scripting magic.

Here is how you can fix the problem if you like colored in-betweens like I do.

First open maya and go to Window > Settings > Hotkey Editor. Under Categories find “Animate”, highlight it.

Next on the bottom right hand side of the “Hotkey Editor” window click “New”.

Name the new hotkey something like “AddColoredKey”. Under description “Change key to special color”. Choose “Mel” as the language. Then in the command box copy and paste this code:
performSetKeyframeArgList 1 {"0", "animationList"};
keyframe -time `currentTime -q` -tds 1;

This code first creates a key and then changes the key color using the -tds command.

Hit “Accept”.

Next assign this new hotkey to a key you want for me I picked “i” because it makes sense, i is for in-between. To do this in the “Assign New Hotkey” box on the top right hand side enter “i” into key. Then click “Assign”, you might get some messages saying that you will overwrite current hotkeys, if you want to overwrite them, which I do for “i” since I never use that command hit okay.

Finally make sure you hit “SAVE” on the bottom left hand side.

Now you should be able to go into the animation timeline and hit the letter “i” on your keyboard. This should enter in a green tween key. You can now slide the other keys around without having it effect the positioning of the in-between.

Happy animating.