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 Tools Search this Thread Display Modes
  04 April 2009
character set query/activation


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!

  04 April 2009
the character command is pretty limiting, better to check the connections directly;

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

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

  04 April 2009
That's terrific! Exactly what I was aiming for, thanks Mark-J
  04 April 2009
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){
     string $ChSet[] = `listConnections -type "character" $objs[0]`;
     if (size($ChSet)>0){
     setCurrentCharacters( { $ChSet[0] } );

Cheers Thanks again!!
  04 April 2009
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
Society of Digital Artists

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

All times are GMT. The time now is 12:54 AM.

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