PDA

View Full Version : channel access



cayd
02-08-2010, 07:53 PM
Looks like the nextChannel function only accesses through scale. How about the other channels. Are they accessible?
ex. Dissolve

Right now Iím pinning all of the scale channels to zero, to zero out the object. There would be less code if I could access dissolve.
- cayd -
I'm doing this in a generic, if that's helpful.

Dodgy
02-08-2010, 09:51 PM
Works for me... What does your code say?

cayd
02-09-2010, 02:54 PM
currently using LW 9.5

nextChannel accesses only thur scale. i actually haven't seen anything in the docs that say it would go any further. Perhaps, in a strict sense, other object attributes are not channels.

However, other object attributes certainly share the envelope data type and can accept channel scripts.

-cayd-

Dodgy
02-09-2010, 08:10 PM
It absolutely works for me, you must be doing something wrong. Can you post your code?

cayd
02-10-2010, 09:41 AM
i tested channel access with name query.

info( channel.name );

after, z scale, an error message was thrown. i will post code, later here when i get a chance.

cayd
02-10-2010, 03:23 PM
Here's that code.
- was tested with a single Null selected.
- after the z scale report, error - invalid object ref

@version 2.2
@warnings
@script generic

generic
{
scene = Scene();
object_array = scene.getSelect();
object = object_array[1];
c = object.firstChannel();
for(i = 1; i <= 9; i++)
{
c = object.nextChannel();
info( c.name );
}
}

Dodgy
02-10-2010, 07:29 PM
This is how the code should look.

@version 2.2
@warnings
@script generic

generic
{
scene = Scene();
object_array = scene.getSelect();
object = object_array[1];
c = object.firstChannel();
while(c) // this ensures all channels of the object are listed not just the first 9
{
info( c.name ); // This should be before, otherwise you miss listing the first channel.
c = object.nextChannel();
}
}

In other words, you couldn't get the dissolve channel as you were only listing the first 9 channels of the item, and your nextChannel() should be the last in the loop as when it gets to the last channel, it will return 'nil' which the 'while' checks for before executing.

cayd
02-11-2010, 05:38 PM
your code is an interesting new way of handling the test. Thank you.
- however -
using your code yielded essentially the same result. so, i continue to conclude that " nextChannel() " can only pass through: x, y, z, h, p, b, x_scale, y_scale and z_scale.

-cayd-

incidentally, the reason i had the loop terminate at 9, was to trip the error.

Dodgy
02-11-2010, 11:58 PM
Did you actually have a dissolve envelope on the item you ran it on? Because it absolutely positively works IF the dissolve channel exists. If you haven't made a dissolve channel, it won't find one.

faulknermano
02-12-2010, 02:07 AM
Did you actually have a dissolve envelope on the item you ran it on?


And to do that:



// assume that the object is selected
CommandInput("AddEnvelope Dissolve");

cayd
02-12-2010, 07:10 PM
i finally have it. thanks guys.

- cayd -