see what condition your condition is in...
Let's talk conditions. Specifically the if then conditional statement.
Lets say you have a joint chain - 5 nodes, named leg, knee, ankle, foot, toe. You want to automaticaly prefix either "rt" or "lf" depending on where the joint is in space. Naming coventions are vital, and it so happens that the right side of your puppet should be on the negative X axis.
So lets say this in english, then in mel...
If the legs translate X is less than zero, name it right, if not name it left. Sounds sassy right. OK mel me on up...
Super cool huh? Here is how to use the else part.
Sweet sassy molassy thats cool! Can you figure out how to prefix all the joints with a similar set up?
Lets say you have a joint chain - 5 nodes, named leg, knee, ankle, foot, toe. You want to automaticaly prefix either "rt" or "lf" depending on where the joint is in space. Naming coventions are vital, and it so happens that the right side of your puppet should be on the negative X axis.
So lets say this in english, then in mel...
If the legs translate X is less than zero, name it right, if not name it left. Sounds sassy right. OK mel me on up...
{
string $leg = "leg";
string $right = "rt";
string $left = "lf";
float $legPos[] = `xform -ws -q -rp $leg`;
if ($legPos[0] <= 0);
{
rename $leg ($right + "_" + $leg);
}
}
Super cool huh? Here is how to use the else part.
{
string $leg = "leg";
string $right = "rt";
string $left = "lf";
float $legPos[] = `xform -ws -q -rp $leg`;
if ($legPos[0] <= 0)
{
rename $leg ($right + "_" + $leg);
}
else
{
rename $leg ($left + "_" + $leg);
}
}
Sweet sassy molassy thats cool! Can you figure out how to prefix all the joints with a similar set up?

3 Comments:
Nice Trick Chad, and useing the rp to check the world space, nice buiding on concepts from earlier posts:)
Now about that pizza..
Mel's Pizza
7532 Ashridge Arnheim Rd - map
Sardinia, OH 45171
937.446.3664
HAAH..
By
bclark, at Wednesday, March 30, 2005 12:39:00 PM
Hehe, Mel's Pizza, hehe.
By
George, at Monday, April 04, 2005 5:38:00 PM
Yeah thats funny Brad :) George...
{
string $foos = "foosball ";
string $gauntlet = "I challenge you to a game of ";
string $tomorrow = "tomorrow";
string $smackTalk = " your going down!";
print ($gauntlet + $foos + $tomorrow + "..." + $smackTalk);
}
By
Chad, at Wednesday, April 06, 2005 10:12:00 PM
Post a Comment
Links to this post:
Create a Link
<< Home