character set query/activation

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
Old 04 April 2009   #1
character set query/activation

Hi,

Im trying to make a script that will make active a character set based on the current selection, but I'm not really sure where to start. The "character" command doesn't seem to work this way.

ex. I have a scene with lots of characters, so for animation I'm doing a lot of jumping around between character sets. To speed up my work flow, I would like to select an animation control curve in the viewport, then run the script to make whatever character set it corresponds to the active character set.

user select-> character_87_bodyControl
run script->
-> check object input, query linked character set
-> activate that character set


Thanks for any ideas!

Cheers.
 
Old 04 April 2009   #2
the character command is pretty limiting, better to check the connections directly;

string $objs[] = `ls -sl -l`; 
string $ChSet[]   = `listConnections -type "character" $objs[0]`;
ClearCurrentCharacterList;
setCurrentCharacters( { $ChSet[0] } );


should do what you're after. Actually it's a nice idea, never thought of switching the active one by default.

Mark
 
Old 04 April 2009   #3
That's terrific! Exactly what I was aiming for, thanks Mark-J
 
Old 04 April 2009   #4
I added a couple of bits of code that will clear the characterSet when you run the script with nothing selected, or with an object that doesn't belong to a character set. This will makes it easy to flip character sets on and off as well.

I put it on a hotkey and it works great!


string $objs[] = `ls -sl -l`; 
     if (size($objs)==0){
     ClearCurrentCharacterList;
     }else{
     string $ChSet[] = `listConnections -type "character" $objs[0]`;
     ClearCurrentCharacterList;
     if (size($ChSet)>0){
     setCurrentCharacters( { $ChSet[0] } );
     }}


Cheers Thanks again!!
 
Old 04 April 2009   #5
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 12:15 AM.


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