woadiestyol
09-12-2008, 04:24 PM
Hey all,
I picked up the Art of Rigging books a while ago and am now finding the time to go through them (since I quit my accounting job and am starting Gnomon in a couple weeks :thumbsup:) I'm a complete MEL & programming newb, and came across a couple items in their stretchy IK script that were breezed over a bit and I'm trying to understand! Hopefully some kind soul might be able to explain these to me (and hopefully I'm not in violation of any copyright issues by posting parts of the script).
1. Using the "setParent" command when creating a UI window as follows:global proc cgTkStretchyIk ()
{
if (`window -q -ex stretchyIkWindow`) deleteUI stretchyIkWindow;
//Main Window
window -title "CG Toolkit - Auto Stretchy Joint Chain" -w 340 -h 50 stretchyIkWindow;
//Button Layouts
rowColumnLayout -nc 2 -cw 1 175 -cw 2 150;
text "Select RP or SC IK Handle: ";
button -label "Make Stretchy" -c "makeIkStretchy";
setParent..;
//Show Main Window Command
showWindow stretchyIkWindow;
}
Does this just say, "Okay I'm done defining the items in my window layout?" I've read through the MEL documentation but I don't really understand what's going on here!
2. Using the "eval" function to find the end effector of an IK handle and store it as $endJoint://Find the end joint where the ikHandle is located.
string $endJoint[];
$endJoint[0] = `eval ("ikHandle -q -endEffector " + $ikHandle)`;
select $endJoint[0];
$endJoint = `pickWalk -d up`;
$endJoint = `pickWalk -d down`;
I guess I'm not really sure what the "eval" function does even after reading the documentation on it. Why not just do it like this:$endJoint = 'ikHandle -q -endEffector $ikHandle'
Thanks in advance to anyone willing to take the time to explain this stuff to me! I'm really enjoying the books so far, but I get hung up on little things like this every now and then. I really want to get good at this stuff, so I don't just want to gloss over things I don't understand.
Cheers,
JP
I picked up the Art of Rigging books a while ago and am now finding the time to go through them (since I quit my accounting job and am starting Gnomon in a couple weeks :thumbsup:) I'm a complete MEL & programming newb, and came across a couple items in their stretchy IK script that were breezed over a bit and I'm trying to understand! Hopefully some kind soul might be able to explain these to me (and hopefully I'm not in violation of any copyright issues by posting parts of the script).
1. Using the "setParent" command when creating a UI window as follows:global proc cgTkStretchyIk ()
{
if (`window -q -ex stretchyIkWindow`) deleteUI stretchyIkWindow;
//Main Window
window -title "CG Toolkit - Auto Stretchy Joint Chain" -w 340 -h 50 stretchyIkWindow;
//Button Layouts
rowColumnLayout -nc 2 -cw 1 175 -cw 2 150;
text "Select RP or SC IK Handle: ";
button -label "Make Stretchy" -c "makeIkStretchy";
setParent..;
//Show Main Window Command
showWindow stretchyIkWindow;
}
Does this just say, "Okay I'm done defining the items in my window layout?" I've read through the MEL documentation but I don't really understand what's going on here!
2. Using the "eval" function to find the end effector of an IK handle and store it as $endJoint://Find the end joint where the ikHandle is located.
string $endJoint[];
$endJoint[0] = `eval ("ikHandle -q -endEffector " + $ikHandle)`;
select $endJoint[0];
$endJoint = `pickWalk -d up`;
$endJoint = `pickWalk -d down`;
I guess I'm not really sure what the "eval" function does even after reading the documentation on it. Why not just do it like this:$endJoint = 'ikHandle -q -endEffector $ikHandle'
Thanks in advance to anyone willing to take the time to explain this stuff to me! I'm really enjoying the books so far, but I get hung up on little things like this every now and then. I really want to get good at this stuff, so I don't just want to gloss over things I don't understand.
Cheers,
JP
