Pages

Sunday, December 30, 2012

Some helpful scripts for Maya

Knowing basic scripting is always useful. Sometimes, I find myself searching how to do something in a 3D package just to realize the program doesn't have the feature. When those cases arrive, I know it's time for some coding.

My knowledge about scripting languages (basically MEL and Maxscript, but learning some Python now... ;)) is basic to intermediate. I don't know the code itself, but I know how to break apart an existing script, understand it and use it to make my own. It's easy for me to understand what some commands do so I can use them the way I want.

When working with Maya, there are some things that would made my life easier, so I decided to write some simple scripts to help me on my workflow. Below are some lines of code that you can grab and use as you like. I have tested these scripts in Maya 2010 (64-bit), so I don't know if they work on other versions.


Select children 

This script will select all the children controls starting from the one you have selected.So for example, if you want to select all the finger controls, just select the first control on each finger (that would be the control closest to the hand) and run the script.

For those of you familiar with 3ds max, this would be like double clicking a control.

string $sel[] = `ls -selection`;
string $namespace = `match ".*:"  $sel[0]`;
select -hi $sel;
string $selChild[] = `ls -s -sl`;
$selChild = `stringArrayRemoveDuplicates $selChild`;
select -r `listRelatives -p $selChild`;

Limitations:
This script will select only controls that are based on SHAPES, so if your rig have some Nulls or other node type as a control, the script won't work.


Playback selection

Sometimes, when working with several viewports at the same time, the playback lags. In order to reduce such lag, this script will enable/disable the playback on just the selected viewport.

Run the script to toggle between playback in ALL viewports or just in the one selected.

if (`playbackOptions -query -view` == "active") playbackOptions -view "all";
else playbackOptions -view "active";



Add keys without disrupting the curve

I got this line from Kiel Figgins at his site while searching for a way to add keys in the Curve Editor without disrupting the curve that I already had.

channelBox -e -exe "setKeyframe -i -at \"#A\" #N;" 1 $gChannelBoxName;

This is the link to Kiel's reference of this command: Link.


Incremental Save

There are a lot of scripts that do this, so I decided to do one too! Nothing special with it, just saves the file with an incremental number at the end each time the script runs, e.g. if the file name is "Test.mb", after the script it will be "Test_001.mb".

Due to the size of the script, I decided to create a .MEL file. To run the script, place the file in your script folder (C:\Users\username\Documents\maya\mayaVersion\scripts) and add a button in a shelf with the following line (you will need to restart Maya for the changes to take effect):

source "kronIncrementalSave.mel";

Link for Incremental save file: Here

Limitations:
The file has to have a name, it can't be "untitled" or else it will save the file as "unknown_001.mb". Also, for some reason that I'm still trying to debug, the first time you run the script you will have the following error:

Error: Invalid call to "substitute".  Check number and types of arguments expected by the procedure.

I don't know why is that, but if you run the script again it should work fine.


Anyways, feel free to try them and if you want to share them, do not forget to give proper credit. ;)

Cheers!



Friday, December 21, 2012

Toon-articulated reel

This is a great demo from Cedric Bazillou of some new ideas for rigging toon characters. I find the Geodesic weight node to be really cool, but not applicable (yet) to video games.



Articulation reel: Toon work-out and tools integration in a deformation rig from cedric bazillou on Vimeo.

Found via Rigging Dojo.

Enjoy!

Saturday, December 15, 2012

Animating Realistic Sword Fights

I just finished reading an article at Gamasutra on how to properly handle a weapon during combat. Here's the link to said article.

It's co-written by an expert swrdsman and what he says applies to both how to properly handle a sword (and the correct stance for it) and some considerations on the technical stuff, like when rigging props.

A must read.

Enjoy!

Wednesday, December 12, 2012

Rotation Orders for Animators

The video below shows how to correctly switch the axis orientation according to the needs of your shot. It's also a great explanation of the importance of it, which most of the times goes unnoticed.



Rotation Orders for Animators from Brian Horgan on Vimeo.

Here's the link for the script in Creative Crash: zooChangeRoo

Also, check Brian's website. Full of useful tools and video tutorials.

Enjoy!

Wednesday, December 5, 2012

A look at the animation of ParaNorman

Here's a look at the animation of ParaNorman, explained LEad Animator Travis Knight.

He says something that I find is true: Bringing a character to life is something very fulfilling.



Enjoy!

From Thinking of Animation

L.A. Times Roundtable Discussion: Animation

This is a great discussion with the directors of all the "biggest" animated films of this year. I have to say that after seeing this video, I'm a big fan of Genndy Tartakovsky.



Enojy!

Monday, December 3, 2012

The Evolution of Jafar by Andreas Deja

This is a great post from Andreas Deja about the evolution of Jafar, for Aladdin.

I strongly recommend to follow his blog, it's a great source for understanding posing.

The Evolution of Jafar:






Enjoy!