Ive been hard at work on a little animation utility to help with zeroing any animated thing in maya to point in space.. For example youve animated an awesome run/jump/death.. but the hips start nowhere near 0,0,0 so on exporting to your game engine theres a whole bunch of issues.

Damn, thats annoying. Heres a gif, below is the explanation and below that is the code..

So I made a script that easily saved me my sanity, in a nutshell all you do is select what you want zerod, e.g the hips of a character.  Then click the “joint to offset” button.

Select the actual world controller thats animated (usually a big round one at the characters feet). Then click the button “Controller to be moved”. (its gotta have a key btw).

Tick which channels you wanna edit.. and below them are some boxes you can enter actual coords if you like ;D

Put in which frame you want it to edit on e.g Frame 0.

Hit the “Check” button and Bang its done ;D

Simply all it does is compares the distance between the coords in the “value to start frame on” boxs with the world position of the “joint to offset” selected, if theres a differance it adjusts the entire the animation curves to shoehorn in the joint to the coords wanted on the channels ticked.

Code below:::::::::::::::::::::::::::::::::::::

string $controlSel=”not selected”;
string $jointSel = “not selected”;
string $checkboxChannelss[];

string $window = `window -sizeable 0 -resizeToFitChildren 1 -title “AnimOffset”
-iconName “AnimOffset”
-widthHeight 100 1`;

rowColumnLayout -numberOfColumns 2 -columnWidth 1 200 -columnWidth 2 300;

button -label “Controller to be moved” -command selControlProc;

textFieldGrp -label “Selected”
-text  $controlSel
-editable false ControlTextField; // this will be the controller to manipulate..

button -label “Joint to offset” -command selJointProc;

textFieldGrp -label “Selected”
-text  $jointSel
-editable false JointTextField;// this will be the goal to move by adjusting the controller

text -label “Translation channels to edit” -align “right”;

checkBoxGrp
-numberOfCheckBoxes 3
-labelArray3 “X” “Y” “Z”
-onCommand ticked
-offCommand ticked
myChkBxGrp;// these are the channels il edit to get the result

text -label “Value to start first frame on” -align “right”;

floatFieldGrp -numberOfFields 3
-value1 0.0 MyDistanceGRP; // Actual float values user puts in

text -label “Frame to start work on” -align “right”;// frame to start script on

intFieldGrp -numberOfFields 1
-value1 0 MyFrame;// Frame to start on that user inputs

text -label “How far off the goal is” -align “right”;

textFieldGrp -label “X,Y,Z”
-text  “distance”
-editable false DistanceToMove;

button -label “check” -command runMetests;

button -label “Close” -command (“deleteUI -window ” + $window);

setParent ..;
showWindow $window;

////////////////////
global proc selControlProc ()
{
string $selObjs[]= `ls -sl `;
$controlSel = “not selected”;
if(size($selObjs)<1)
{
//do nothing
}
else
{
$controlSel = $selObjs[0];
$controlSeld = $controlSel;

}

textFieldGrp -edit -text $controlSel ControlTextField;
}
///////////////////
global proc selJointProc ()
{
string $selObjss[]= `ls -sl `;
$jointSel = “not selected”;
if(size($selObjss)<1)
{
//do nothing
}
else
{
$jointSel = $selObjss[0];
$jointSeld = $jointSel;

}

textFieldGrp -edit -text $jointSel JointTextField;
}
//////////////////
global proc ticked ()// decide on whats ticked
{
int $xTicked =`checkBoxGrp -q -value1 myChkBxGrp`;
int $yTicked =`checkBoxGrp -q -value2 myChkBxGrp`;
int $zTicked =`checkBoxGrp -q -value3 myChkBxGrp`;
int $xyzStates[] = {$xTicked,$yTicked,$zTicked};

}
//////////////////
global proc runMetests ()
{
//need to go to the frame specified.. before calculating..
int $frameStart = `intFieldGrp -q -value1 MyFrame`;

currentTime $frameStart;

//user input coords for the goal to end up at..
float $targetX =`floatFieldGrp -q -value1 MyDistanceGRP`;
float $targetY =`floatFieldGrp -q -value2 MyDistanceGRP`;
float $targetZ =`floatFieldGrp -q -value3 MyDistanceGRP`;

float $pointB[]= {$targetX,$targetY,$targetZ}; //gives the 3 floats of where i need the object to be

string $values = `textFieldGrp -q -tx JointTextField`;
//the users selected goal to be moved (not the actual thing i move though..)
float $pointA[]=`xform -q -ws -a -t $values`; // gives 3 float values of where the object is in the world!

float $distanceX = $pointB[0] – $pointA[0]; // adds all 3 XYZ together// need to work out a way to not do that
float $distanceY = $pointB[1] – $pointA[1];
float $distanceZ = $pointB[2] – $pointA[2];
string $distances= $distanceX+$distanceY+$distanceZ;

//broken at the minute
textFieldGrp -edit -text $distances DistanceToMove;
//still need to work out distances but for each channel alone!

$xTicked =`checkBoxGrp -q -value1 myChkBxGrp`;
$yTicked =`checkBoxGrp -q -value2 myChkBxGrp`;
$zTicked =`checkBoxGrp -q -value3 myChkBxGrp`;
int $frameStart = `intFieldGrp -q -value1 MyFrame`;

select -clear;

if($xTicked<1)
{
//do nothing ignore and move on..
print “doing nothing for x channel”;
}
else
{
//run the entire loop but just for x..
print “start doing x channel”;
string $objectInUse = `textFieldGrp -q -tx ControlTextField`;
string $objectAndChannel = ($objectInUse + “.” + “tx”);
string $chans = (“.” + “tx”);
//float $val[0] = `keyframe -at $chans $frameStart -q -eval $objectInUse`;//should find the
//print $val[0];//need to make validateShelfName[0] be the distance no
$val[0]= $distanceX;

if($val[0] != 0)
{
select $objectInUse;
float $valChange = $val[0];
keyframe -edit -relative -vc $valChange -time “-200000:2000000″ $objectAndChannel;
print “sorted”;
}
select -clear;
}

if($yTicked<1)
{
//do nothing ignore and move on..
print “doing nothing for y channel”;
}
else
{
//run the entire loop but just for x..
print “start doing y channel”;
string $objectInUse = `textFieldGrp -q -tx ControlTextField`;
string $objectAndChannel = ($objectInUse + “.” + “ty”);
string $chans = (“.” + “ty”);
//float $val[0] = `keyframe -at $chans $frameStart -q -eval $objectInUse`;//should find the
//print $val[0];//need to make validateShelfName[0] be the distance no
$val[0]= $distanceY;

if($val[0] != 0)
{
select $objectInUse;
float $valChange = $val[0];
keyframe -edit -relative -vc $valChange -time “-200000:2000000″ $objectAndChannel;
print “sorted”;
}
select -clear;
}

if($zTicked<1)
{
//do nothing ignore and move on..
print “doing nothing for z channel”;
}
else
{
//run the entire loop but just for x..
print “start doing z channel\n”;
string $objectInUse = `textFieldGrp -q -tx ControlTextField`;
string $objectAndChannel = ($objectInUse + “.” + “tz”);
string $chans = (“.” + “tz”);
//float $val[0] = `keyframe -at $chans $frameStart -q -eval $objectInUse`;//should find the
//print $val[0];//need to make validateShelfName[0] be the distance no
$val[0]= $distanceZ;
print($val[0]+”\n”);
if($val[0] != 0)
{
select $objectInUse;
float $valChange = $val[0];
keyframe -edit -relative -vc $valChange -time “-200000:2000000″ $objectAndChannel;
print “sorted”;
}
select -clear;
}

print “Done all script”;

}

Its official, or a brilliant hoax.

I think this just goes to show that even the best games studios can appeal to god like animators such as Mr Keith ;D

http://keithlango.blogspot.com/2009/10/i-solve-practical-problems.html

Almost at the end..

4 October, 2009

My 3rd and 4th games are almost out the door and my 1st proper attempt at a personal piece in a year is almost done too so not such a shabby a year ;D

My 3rd game soon to be released..My 4th game soon to be released..:

lego

quest

My short so far ;D

A weeks worth of love..

25 September, 2009

Enjoy..

Nowhere near the end yet, got a whole scene planned, this of course keeps changing to a bigger and longer scene but what the hell ;D

More progress..

21 September, 2009

Almost happy with the results now..

Almost there..

18 September, 2009

A new Rig a new model and more free time = an update.

Made a few new scrits that helped me rig the cavetroll pretty quickly.

More free time to tweak..

7 September, 2009

Finally got around to being happy with my cavetrolls poses, will be completely changing the models at some point soon as my rigs are ready..

Also at some point il be releasing some early scripts ive done, ;D


Had a little free time to doodle some new ideas into my animation, thats all your gettin for now untill crunch time on rockband is over.

Animation layers..

16 August, 2009

Havent updated the blog in ages, been a crazy year!

Anyways back on topic, They rock!

This is basically a simple exercise that took about an hour to wrap my head around, but there brilliant.

I MADE IT! ..

14 September, 2008

..Thus this blog hasnt been updated in quite a while.

A mad week essentially happend in April this year when I was asked if I wouldnt mind doing a animation test for TT-Fusion.

It was a very mad hectic week, with little to no sleep while I battled to learn Maya enough to get what I needed done. 3 days after recieving the test I handed it back on a very late thursday night and waited eagerly. That friday morning I got a enthusiastic reply and that evening after 2 long train rides I was At the office for my interview. It was bloody brilliant.

I left the office with a really warm feeling haha, within the hour on the train I recieved an email offer, and that is where my life changed!

I MADE IT!

 

I started April 22nd and have never been so happy, man its just, bloody awesome! I wish to dear god i could show the stuff ive done but its good enough that people will see it ingame ;) !!!

This past 5 months (bloody flown btw, still feels like 1st tbh) I’ve improved beyond belief in Maya and im now so comfortable, And being surrounded by awesome people who have a world of knowledge is such a neat thing!

The old cliche that 3 years at University holds nothing to your 1st coupe weeks on the job, is so bloody true!