Wednesday, October 19, 2011

Back In It

So I've been in school and had this half-job that pulled me away just as I was starting this thing but the guy who half-hired me is out of the picture, so fuck it I'm back here to finish this full body rig, a face rig, and a UI to operate and manage animation on both rigs. So my scripts have a setup, a base to which a user can pick the positions of the joints. The makeTorso looks for your $characterName hip and should locators to layout the torso. The makeNeckHead does the same thing when creating the neck and head controls. The makeArm script has to look for more points instead of just two so instead we'll just check to see if the beginning and ending locators exist, assuming that if the first and last exist all other specific points in between do too. This should be the cap stones for the script:

makeArm(string $characterName)
{
//do both of these exist? &&

if( (`objExists ($characterName + "_cnst_left_collar_loc")`) && (`objExists ($characterName + "_cnst_left_handEnd_loc")`))
{
print "We've got an arm!";
//arm code inserted in here
} else {
warning("No construction arm points exists!");
}
}

This is just to properly error out, so you know when and where the script went wrong. But I got ahead of myself, what about left and right arms? I don't want to have to write a script to cover both left and right. I would rather right a script that could easily toggle which $side I am operating on. So I will create a string variable array with left in the [0] and right in the [1]; string $side[] = {"left", "right"};

So actually the very beginning should be a one-two loop to repeat everything once for the left, and once for the right. I'll continue this tomorrow.

Wednesday, August 3, 2011

Current Collection of Scripts

This is the collection of scripts I've written in MEL so far. Maybe not everything, but all the scripts relating to rigging and one of my most recent scripts. The order for creating the rig is:
 - 1 - Load the Utiilities
 - 2 - Load Rig Setup
 - 3 - Load Torso
 - 4 - Load Neck/Head

To which then will follow the Arms, followed by the Legs, followed by extra features. The utilites hold all scripts that aid in the setup and individual body part creation (constrainShit03 needs to go into that collection). radialScale01 was just a recent test for the reveal of a city, in which building grow if within range of two circles.

Links for download:

Wednesday, July 13, 2011

Rig Setup

So this is probably among some of the first script I wrote, pretty basic laying the rig out by creating locators for each joint, creating lines in between locators to signal joint structure, and then creating spherical displays for the user to grab and position in place of their characters joints.

For this I wrote two simple utilities; one for drawing lines between selected objects and another for creating displays on top of and control selected objects.

I'll post this one here now, and the other utility up later today, and then hopefully the entire rig setup.


////////////////////////////////////////////////
//DRAW LINE
//by SL
//
//This will draw a line inbetween multiple objects in order of //their selection.
//It will also attach the CVs to what was selected in order.
//automatic naming, eg: [$characterName_$part_drawLine]




proc drawLine(string $characterName, string $part)
{
//define variables
string $characterName;
string $part;
string $sel[] = `ls -sl`;
int $selSize = size($sel);
vector $Current;
int $counter;
vector $points[];
string $linePoints;

//put selected points into vector array
for ($counter = 0; $counter < $selSize; $counter++)
{
$points[$counter] = `xform -q -ws -t $sel[$counter]`;
}

//selection cleared, make a string from stored vectors
for ($counter = 0; ($counter + 1) < $selSize; $counter++)
{
vector $Current = $points[$counter];
if ($counter == 0)
{
$linePoints = ("-p " + ($Current.x) + " " + ($Current.y) + " " + ($Current.z) + " ");
}
$linePoints = $linePoints + ("-p " + ($Current.x) + " " + ($Current.y) + " " + ($Current.z) + " ");
}


string $crvName = ($characterName + "_cnst_" + $part + "_drawLine");
string $crv = `eval ("curve -d 1 " + $linePoints + "-n " + $crvName + ";")`;


for ($counter = 0; $counter < $selSize; $counter++)
{
connectAttr -f ($sel[$counter] + ".t") ($crv + ".cv[" + $counter + "]");
}
}




So the way this works is I'm gathering world vector positions of the objects and then assembling them into a string in which I will run an  eval  command. The assembled string flags each point to put a CV. The result of the eval command is the name of the string we just created. Then after the curve has been created, in order to connect all the CVs to the objects, we must cycle through again in a for loop using the arrays $sel[]  and ($crv + ".cv[]").  The translate of the object ($sel[$index] + ".t") gets connected into the CV $index.


There is no script checking to make sure user input is a string and not a vector array. To do so a validate string function would be useful to test if the input is a string. If true, do your work, if false, error out.

Tuesday, July 5, 2011

I Love Beer

Let it be known to the world, that I, Sean Louis Rove, love beer. Not only to I love beer, but I am in love with it and intend to celebrate my love by making a 4-color tee to show my love. And what an exciting time, I just built a 4 color screen printing press. Woo Hoo! Design in progess:


Bipedal Rules

So I've been breaking down Rules for building a bipedal rig for any character. These rules will hopefully be able to define a wide range of bipedal characters and their needs for a rig. I've gone through all resources of the Animator Friendly Rigging by Jason Schleifer, which is very detailed and skillfully crafted, and I've decided to base the automatic bipedal rig on the AFR rig with some added bonus features to maximize functionality and efficiency for animators everywhere.

These rules are very basic and will help with the layout of the character system.

Rule #0: What's your name?

Every character has a name, for example, robertPaulson. When several character rigs are in one scene, and they all are built the same way and have all the same parts, performing procedures will only require a root name change. Procedure's input variables should always state first which character is being operated on, followed by any options. $characterName seems to fit nicely as a variable.


Rule #1: Roots = Torso

Every bipedal character has a torso, with presumable the center of gravity(pivot point) at the hips. The torso is the main component of the character because parts of all the other systems has its roots in the torso. This is the first part of the rig to be created, and should set up the appropriate nodes to house the entire character rig ($characterName + "_ALL"). The torso should have all the standard ik/fk, squash/stretch, and twisting features that one would expect the spine to be capable of. ***As a side note, I would like to mention that I've been doing Yoga, and my spine has never felt better. I sit in front of a computer for too long and it feels great to get up and stretch, even if just or 20 minutes a day, DO IT!***


Rule #2: Heads Up

As far as I know, everyone's head is attached to their body by their neck. Some people may have two heads, or even more, so there should be an option to add additional heads. Each head has its own controls but also has the option to mirror the other head ($follow the $leader). This portion of the rigging will not go into facial rigging, in fact that will be a separate setup system.


Rule #3: Arm and Hammer

Not everyone has two arms. There just may happen to be a zombie apocalypse where one-armed/no armed zombies are wandering around, or if you happen to run into a four-armed beauty you may find the need to adjust the number of arms. A pair of arms is standard, but option to change should be as easy as a plus and minus button. Hands will be at the end of every arm, but with the option to pick the number of fingers. Hands will have built in expressions; relax, scrunch, spread and so on. Hand controls will have the option to become the $newParent of a $newChild, with the option of at anytime disown the child.


Rule #4: Get a Leg Up

It is "Bipedal" for a reason. Each rig will come with two legs, each leg will have pole-vector and no-flip solvers. Feet will will include interactive ground planes and standard foot movements; roll, twist, lift, etc.


Rule #5: Anywhere @ Anysize

No, exceptions.



This is the basics of the rig setup, while I mentioned a few features in each area, more may be included as each area will be developed and explained as built. So once the user has decided all the features and number of limbs/digits, a mock-rig with display point will appear for the user to position the points of the rig. After which the user can push a button for the rig to be assembled. Easy, right?

Friday, July 1, 2011

Background Basics

Hello, my name is Sean Louis. I went to school at the University of Colorado Denver for a BFA in Computer Animation. I've been out of the classes for a year, but in the last year I've continued learning Maya into the MEL/Python direction. I've read MEL Scripting for Maya Animators and am currently half way through Professional MEL Solutions for Production. MEL for Animators is a great basic book for learning the syntax and structures of MEL. I'll offer a more in depth book review for both of these books maybe in a few posts.

So I should cover what project I am scripting, how I am organizing it and so forth. I've begun writing an automatic rigging system MEL. This is something that I know has been done before, nothing new, but in my quest of doing this, I am honing my rigging and scripting skills, and hopefully going to make this easy for a lot of people. It would be nice to have a rig for the entire production line; meaning when I setup an animation rig it would be nice if there was a rig to skin to, tools to import animation onto a rig or export it out, interactive parenting, customizable features for each rig depending on the number of limbs needed, and all around easy to use controls.

I will have to upload some drawings of the beginning setup for the rig.

Useful Practices

Wow, it is funny when right after finishing a script, and making sure everything works, print out the entire script and clean it up with old fashion pen and ink. With it out on paper it is easy to see the script as a whole, what parts are working, and what parts are unnecessary duplicates of others. It allows you to see the flow of execution, are thing happening in the right order? Well, they are now!