PDA

View Full Version : simple mel question


Seemoo
07-19-2007, 09:52 PM
I'm trying to write a little script and can't remeber how to do a small thing. I'm sure for some of you pros it's a simple question to answer.

string $sel[] = `ls -sl`;

This commend is used to store the selected objects into the string variable $sel.

Now, is there a way to store the selected channels on an object into a string variable?
For example:
I have an object Cube. All channels have animation on them but in the Graph Editor i have only two channels selected Cube.tx, Cube.ty. What command would store Cube.tx and Cube.ty into a string variable?.

thanks for your help.

rtngkllr
07-20-2007, 02:18 AM
string $attrs[] = `channelBox -q -sma mainChannelBox`;

lostfilez
07-20-2007, 08:04 PM
If you're trying to pull the selected channels from the channel box, the previous command will work, but if you're looking for the selected channels from the outliner inside of the graph editor, you need a different command:

string $attrs[] = `selectionConnection -q -obj -keyframeList graphEditor1FromOutliner`;

I believe that should work for ya!

Seemoo
07-20-2007, 10:26 PM
thank you both. I will give them a try.

thanks again!

CGTalk Moderation
07-20-2007, 10:26 PM
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.