Thursday, February 9, 2012


The title says is all.  I'm a little discouraged today.  Why?  I feel like no one wants a Hair/Cloth/Fur TD.  I love what I do and I think I'm good at it.  I'd love to work on hair, cloth and fur for ever and ever, but I see so few people looking for character fx artists.  I love effects (especially particle effects), I love rigging, and I think if I were to buckle down and do absolutely nothing but FX tests and rigs for, like 9 months, I could build enough on what I already know and produce good results and find a decent entry level job.  But I don't want to get a job doing something that I just happen to know how to do well.  I want to get a job doing something that makes me happy.

Maybe I'll find something at SIGGRAPH this year.

I'll stop whining now.


Friday, February 3, 2012

MEL Script -"Unfreezing" Transformations

Someone on CGTalk had 100+ objects in their scene where the transformations had been reset.  He needed their world space positions restored.  Plainly speaking, he needed to unfreeze transformations.  Technically that isn't possible, but there's a way to cheat everything.

There's probably a more efficient way to do this.  If someone reply's to my post on CGTalk with a better version, I'll post their version, credit them, and provide a link to their post.  In any case, here's the "Unfreeze Transformations" script.  I hope it helps someone.

//Get all of the selected items, and the size of the selection
string $selection[] = `ls -sl`;
int $size = size($selection);
int $i;
//for each object in the selection, do the following things:
for ($i = 0; $i < size($selection); $i++){
     //Create two locators.  #1 stays at the origin (0 0 0) while #2 moves to the center of the selected object.
     string $zeroLoc[] = `spaceLocator`;
     string $loc[] = `spaceLocator`;
     string $ptCon[] = `pointConstraint $selection[$i] $loc`;
     string $orCon[] = `orientConstraint $selection[$i] $loc`;
     //Get the translation and rotation values of the locator we just moved.  These are the values that we'll give to the object in a few steps.
     float $tran[] = `xform -q -t -ws $loc`;
     float $rot[] = `xform -q -ro -ws $loc`;
     //Delete the constraints, we don't need them anymore
     delete $ptCon;
     delete $orCon;
     //Move the selected object to the 0 0 0 locator (that's at the origin), then delete the constraints.
     string $ptConZero[] = `pointConstraint $zeroLoc $selection[$i]`;
     string $orConZero[] = `orientConstraint $zeroLoc $selection[$i]`;
     delete $ptConZero;
     delete $orConZero;
     //Freeze Transformations on the object.  Now the objects values are zeroed out and it's at the origin  
     makeIdentity -apply true -t 1 -r 1 $selection[$i];
     //Move the object back to it's original position, using the translation/rotation values from the first locator we created and moved.
     setAttr ($selection[$i] + ".translate") $tran[0] $tran[1] $tran[2];
     setAttr ($selection[$i] + ".rotate") $rot[0] $rot[1] $rot[2];
     //Delete the two locators we created, we don't need them anymore.
     delete $zeroLoc;
     delete $loc;