MEL: a script for creating handCtrl's ?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  11 November 2002
MEL: a script for creating handCtrl's ?

Hi,

I would like to know if there is a script that can create attributes for the hand?

Example:
Say that you have to rig about 10 characters, and on every hand you want to have about 5 attributes (fist, grab and so on)
This would add up to 100 attributes and say that it takes about 2minits for every setup. That's 200 minutes, 3,3 hours of repeatedly waste of time:-)))

So could some MEL geniuses tell me how to create a script that creates this for me?
I guess you would be forced to great some kind of menu to state what kind of hand you have, four or five fingers and so on!!

I have been trying to create this but I'm not that good at MEL..

Thanks
/Tommie
__________________
/Tommie
www.pigbelly.com
 
  11 November 2002
Heya,

pretty simple to add the attributes really.. you can do something like this:


// create an array of control names
string $names[] = { "fist", "grab", flipOff", "point" };

// get the selected objects
string $objs[0];
$objs = `ls -sl`;

// looop through the selected objects and add the attributes
for ($ob in $objs)
{
	for ($attr in $names)
	{
		addAttr -longName $attr -at double $ob;
		setAttr -k 1 ($ob + "." + $attr);
	}
}

__________________
jason schleifer
Animator - http://jasonschleifer.com/
Co-Founder - http://www.nimblecollective.com
 
  11 November 2002
Great works like a charm but:-)) (always a but:-)

I would like it to actually create the setDrivenKey animations on the fist, grab and so on!!

That's what I meant with the need for some kind of UI to determine the hands construction and then I have to figure out a way to make MEL understand which bone hierarchy is the thumb or pinky:-))

I'm lost....:-(

/Tommie
__________________
/Tommie
www.pigbelly.com
 
  11 November 2002
ah ,can't you do it based on name? if you have a consistent naming scheme, you should be able to do something like:

$children = `listRelatives -c $handJoint`;
string $child;
for ($child in $children)
{
// thumb
if (`gmatch $child "*thumb*"`)
{
// do thumb stuff
}
}


??
__________________
jason schleifer
Animator - http://jasonschleifer.com/
Co-Founder - http://www.nimblecollective.com
 
  11 November 2002
Hi, I don't know that much about mel script, but if you have a consistent naming scheme for your joints, like Mr.schleifer said, then you can make hand controls with Set driven keys, and then copy and paste from the script editor to the tool bar, and Viola! Instant Mel script, will work on any scene if you have the joints named the same. Saves alot of repetitive work, no sense in re-inventing the wheel
__________________
*Insert pretentious quote here*
 
  11 November 2002
Super!!
It works perfectly.
But I'm a bit allergic to repetitive tasks so I will make a naming script:-))

Laziness is the mother of inventions :-))

Thanks!!

/Tommie
www.pigbelly.com
tommie@pigbelly.com
__________________
/Tommie
www.pigbelly.com
 
  11 November 2002
hey jason,

i'm able to add attribs to an object no prob, but i can't get it to show up in the channel box. it shows up in the attrib editor, but i usually like to animate from the channel box. any hints?

here's my script:

addAttr -ln ThumbCurl -at double -min -1 -max 1 -dv 0 l_hnd_cntrlr;
setAttr -e -keyable true l_hnd_cntrlr.ThumbCurl;
 
  11 November 2002
hmm.. setting it keyable usually puts the attribute in the channel box.. are you sure it's not there?
__________________
jason schleifer
Animator - http://jasonschleifer.com/
Co-Founder - http://www.nimblecollective.com
 
  11 November 2002
talk about service with a smile that was quick. yah, i clicked on and off the object and it wasn't there. it does show up in the attrib editor under extra attributes though. didn't know if i was missing a step or anything. thanks for the help.

(and you're siggraph lecture rocked by the way :xtreme: )
 
  11 November 2002
It works fine for me!!

/Tommie
__________________
/Tommie
www.pigbelly.com
 
  11 November 2002
i'll try it on a diff file later on. must.......keep.......rigging...........

 
  11 November 2002
pff

damn oke this goes above my head.. really great do.. but im using max.. rigging my character soon .. but im not good at it yet,,but whats up with the scripts and so on.. dont know.. could someone teach mee or something caus i really want to learn it all the right way..

could someone help mee..
 
  01 January 2006
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:24 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.