PDA

View Full Version : Art of Rigging MEL Help


rustymclellan
10-30-2005, 02:12 AM
Hey guys, I just bought Art of Rigging and I'm looking at some code from the first chapter. At the end of the chapter, they author sets up an auto rig for inverse foot and IK/FK switch. I was having trouble understanding this part of the code:

if ($legWarning == 0)
{
if (!( (`objExists ($legSide + "Hip")`)
&& (`objExists ($legSide + "Knee")`)
&& (`objExists ($legSide + "Ankle")`)
&& (`objExists ($legSide + "Ball")`)
&& (`objExists ($legSide + "Toe")`)
&& (`objExists ($legSideLong + "FootControl")`)))
{
$legWarning = 1;
warning "Unable to find all required objects to setup leg. Please ensure all objects are named properly. \n";
}
}



The way that I read this is that if all of those objects exists, then this makes the legwarning switch to 1 (which means that the script will not continue). I would think that if all of these objects exist, then legwarning will remain at 0 (no errors) and the script will continue. Is there somethign I'm missing here?

john_homer
10-30-2005, 07:34 PM
it has the "not" (welll thats what I call it, I taught myself, so probably dont use "propper" terms ; ) operator at the start... the "!"

that basically "inverts" the result... hmm hard to word...

its not saying "if all of these objects exist".. its saying...
if ( NOT ( all of these objects exist)

.j

rustymclellan
10-30-2005, 10:04 PM
Thank you. I guess it sort of works like the != as well. Makes sense in the context of the code that comes next.

SajNT
10-30-2005, 10:08 PM
if (!( (`objExists ($legSide + "Hip")`)
&& (`objExists ($legSide + "Knee")`)
&& (`objExists ($legSide + "Ankle")`)
&& (`objExists ($legSide + "Ball")`)
&& (`objExists ($legSide + "Toe")`)
&& (`objExists ($legSideLong + "FootControl")`)))

$legWarning = 1;

warning "Unable to find all required objects to setup leg. Please ensure all objects are named properly. \n";

yup. a "!" always means a NOT. So basically if ($legSide + "Knee") etc does NOT exists, give a warning.

rustymclellan
10-31-2005, 03:07 AM
Hey guys, another quick question about the MEL script from chapter 1 of art of rigging. I understand most of the code from this section of the book, but have one final question from this chapter. Whenever I type in cgTkSetupLeg left; it works fine, but when i go to do the right leg, it gives me the error:

// Warning: Skipping rHip: It has non-zero rotations. //
// Warning: Skipping rKnee: It has non-zero rotations. //
// Error: No object matches name //

And it doesn't complete the right side auto setup. Did this happen to anyone else?

Bonedaddy
10-31-2005, 06:21 AM
I remember having problems when I had to run that script more than once. It's a nice auto-rigger, but it works only on clean files. I had to edit it pretty heavily to get it to work in a piecemeal fashion. Basically, it often looks for effectors and constraints by what it expects them to be named (i.e. "effector7"), but if that isn't what they're named (i.e. you already have an "effector7," so the new one is named "effector8"), it'll bug out.

john_homer
10-31-2005, 09:21 PM
... it often looks for effectors and constraints by what it expects them to be named (i.e. "effector7"), but if that isn't what they're named (i.e. you already have an "effector7," so the new one is named "effector8"), it'll bug out.

wow! I really dont mean to offend anyone (and I've never looked at the script in question) but if thats true, its incredibly bad scripting practice...

.j

rustymclellan
11-01-2005, 01:30 AM
Hey guys,

I hope no one minds if I turn this into the post for MEL help for Art of Rigging. I've finished chapter 2 and am starting to have some thoughts on building my own scripts. One of the first things I would like to do is combine the stretchyIK for limbs with the IKtoFK skeletons. First, I guess, I would like some insight concerning rigs with both of these types of scripts. What are some suggestions?

On to my first thoughts regarding this matter:

The easy way to connect the real skeleton to the IK skeleton would be to point constrain/parent constrain the real leg to the IK skeleton (along with orient constraining the joints). When the IK skeleton begins to scale now, so does the real skeleton. So all is fine so that the real follows the IK skelly as expected. The problem is that when I parent/point constrain this real skeleton to the IK skeleton, the real skeleton will not move to the position of the FK skeleton when I use my IKtoFK switch (obviously cause its point/parented to the IK skeleton). Anyone have any ideas about how to get around this problem so that real skeleton will follow the stretchy IK one, but may also move to the FK skeleton when needed. Also, would it be good rigging practice to scale the joints of the FK skeleton when the IK Skelly's joints get scaled from the stretch? Thanks alot, hope someone has some good insight!

rustymclellan
11-01-2005, 02:46 AM
Hello again,

I got the IKFK blend to work with the parent constraints, just needed to weight the values over the SDK of the controler IKFK switch. Anythign else I should include know about when combining these two different scripts into one? Do I want a scale or no scale button on my foot controller?

Bonedaddy
11-01-2005, 06:29 AM
wow! I really dont mean to offend anyone (and I've never looked at the script in question) but if thats true, its incredibly bad scripting practice...

.j

I just wanted to clarify, this is the Making of Leon DVDs, not the Art of Rigging (I get the two confused in my head sometimes). And I got it pretty early on, so maybe it's been changed in later versions. While it's a bit annoying, I did learn a lot from that rigging DVD, so I would still recommend it.

But yeah, it was a bugger to track that down.

CGTalk Moderation
11-01-2005, 06:29 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.