Friday, November 20, 2009

shelf buttons….tangent switching

I mentioned a workflow I use of switching tangent types even in the early stages of an animation to evaluate timing.

Here’s a few shelf buttons/mel commands you can use to avoid having to do a lot of clicking in maya. Just save the icons to your images directory and add them in. Were I more clever, I’d build a UI for this. The first 3 scripts change selected keys in the timeline (or graph editor) to different tangent types. The following 3 determine what sort of keys you’ll set next. Enjoy! They save me a ton of time.

 

keylinear 

//change selected keys to linear
keyTangent -global -itt linear;
keyTangent -global -ott linear;

stp 
//change selected keys to stepped
keyTangent -global -itt flat;
keyTangent -global -ott step;

pl //change selected keys to plateau
keyTangent -global -itt plateau;
keyTangent -global -ott plateau;



keylinear 
//change key type to linear
evalEcho "timeSliderSetTangent linear";
timeSliderSetTangent linear;

stp 
//key type to stepped
evalEcho "timeSliderSetTangent step";
timeSliderSetTangent step;

pl 
//change timeslider to plateau
evalEcho "timeSliderSetTangent plateau";
timeSliderSetTangent plateau;

2 comments:

barbatruc said...

First : sorry for my english (I'm french)

Then : fine blog !!

personally, I used to use a shortcut (for example "alt + t") with a little script like this :
-------------------

string $tangent[] = `keyTangent -q -itt`;
for ($tan in $tangent)
{
if ($tan == \"flat\")
{
keyTangent -e -itt spline -ott spline;
}
else
{
keyTangent -e -itt flat -ott flat;
}

-----------------------

so I can switch my tangents in the graph editor between flat and spline (with only one shortcut) because I only use stepped for the blocking pass... and plateau is either flat or spline.

But then I discovered the "comet AutoTangent" script (you can find it easily on the net) and now I only use it with this shortcut :

-----------------

source "C:/yourPathToTheScript/autoTangent.mel";
aTan_smoothKeys 0.0 1;

-----------------------

the first argument represents the softness (0.0 means no overshoot) and the second argument represents the chekbox "Flatten start/end key"

When you are use to it It saves a lot of time. You can stop thinking at your tangents.
The only thing you have to do is to have a "traditionnal" approach.
For example to make an "ease in" you put a key few frames before your ending pose then shift your ending pose few frames further (or this new key earlier) and fix all your tangents with the autoTangent shortcut.
You have no unwanted overshoot and your ease in is good enough.
It becomes really easy then to make an animation look less "computer-made" by inserting keys before or after your extreme poses then shift a little the poses or the new keys left or right in your timeline. Then fix all the tangents with autotangent.

With this method it becomes realy easy to make actings look more stiff or less regular with little accelerations or pauses (but no fix) without handle with your tangents weights and etc...

The only disadvantage is that autoTangent is a little bit slow when you have many curves selected...

Hope it will be helpfull...

go on with your blog it's interesting.

Potof.

Olivier Ladeuix said...

I usually block in step and also use Michael Comet's Autotangent with the shift + S hotkey to spline