PDA

View Full Version : Getting ALL the channels of a certain object



Kvaalen
07-05-2004, 05:10 PM
There doen't seem to be a way to find all the channels of a certain object in layout. If I use the normal firstChannel() and nextChannel() method, it doesn't find them all (like the endomorphs for instanace). If I use the ChannelGroup() method, it finds all the channels but there is no way to find out to what object the morph channels it finds belong.

Is there a way to find ALL the channels of a certain object?

Any help would be really appreciatd. Thanks. :)

faulknermano
07-06-2004, 09:18 AM
If I use the ChannelGroup() method, it finds all the channels but there is no way to find out to what object the morph channels it finds belong.

use ChannelGroup() starting from the Scene Object Agent. dont use it by itself.

if you're using Morph Mixer as your deformer, then a MorphGroup will be under the object in question.

so:


// select an item with endos and with morph mixer applied
generic
{
s = Scene().firstSelect();
a = ChannelGroup(s.name);
b = ChannelGroup(a);
bc = b.firstChannel();
info(b);
info(bc);


}


b is the MorphGroup. bc is the first channel in the group. you will see here that you came from the item (s) and moved down to get the MorphGroup, so you know exactly where you came from, and can refer to the item again.

to get ALL of the channels, you must use recursion. It's actually in the docs.. about recursion i mean. check it out.

good luck.

Kvaalen
07-06-2004, 04:10 PM
OK. It was the recursion that I was missing out on.
Works alright. Thanks for the help. :)