PDA

View Full Version : Layer orientaion > lights POI?


tcastudios
02-04-2006, 12:09 AM
Hi. This was harder to try to solve than I thought....
I export a scene from Cinema4D using .aec. Then I have Lights that I place 3D layers on in AE.
I can place the layers fine using "snapping" the positions but...
I cannot for the life of me, have the layer to rotate with the Light (They are animated).

What I'm trying to do is to have the layer lookat the Lights PointOfInterest.

Any sore attempt to use code/expression that I have found at various sites doesn't cut.

Any help much needed.

Cheers
Lennart

Mylenium
02-04-2006, 08:46 AM
Hi. This was harder to try to solve than I thought....
I export a scene from Cinema4D using .aec. Then I have Lights that I place 3D layers on in AE.
I can place the layers fine using "snapping" the positions but...
I cannot for the life of me, have the layer to rotate with the Light (They are animated).

What I'm trying to do is to have the layer lookat the Lights PointOfInterest.

Any sore attempt to use code/expression that I have found at various sites doesn't cut.

Any help much needed.

Cheers
Lennart

You just didn't look hard enough. There's a milion expressions to do targeting, even in 3D space. The simplest one involves the lookAt() method. another way might be using atan() based on deriving positional differences first. If you follow the link in my signature, you will find several examples on my website that use one or the other technique, though in 2D. It shouldn't be difficult to adapt them for your purposes.

Mylenium

tcastudios
02-04-2006, 12:47 PM
Hi Mylenium and thanks, I'll have a look. The main problem is that I'm new at expressions in AE, having syntax problems... I do programming in Cinema ( see sign), so hopefully I'll catch up in AE as well.

I did forget to tell that the Camera moves as well in the scenes. So if it is anything special I should think of because of that I'd be happy to know.

May I ask, if a LightLayer is considered as a layer in expressions? I did get an error stating that the layer "Targetlight" (the name of my light) was not found. (I checked spelling)

Thanks again

Cheers
Lennart

Mylenium
02-04-2006, 02:32 PM
Hi Mylenium and thanks, I'll have a look. The main problem is that I'm new at expressions in AE, having syntax problems... I do programming in Cinema ( see sign), so hopefully I'll catch up in AE as well.

I did forget to tell that the Camera moves as well in the scenes. So if it is anything special I should think of because of that I'd be happy to know.

May I ask, if a LightLayer is considered as a layer in expressions? I did get an error stating that the layer "Targetlight" (the name of my light) was not found. (I checked spelling)

Thanks again

Cheers
Lennart

since all items in the timeline are layers in the strict thinking of AE, you shouldn't have any problem referencing them. Could be a syntax problem. Should be something like this:

my_light=thisComp.layer("Targetlight");
my_position=my_light.position;

...

and so on. You would only check the type of layer for scripts or if you needed to know certain things for your expressions (is3D, isVisible etc.) You may also need to use layer space transforms (e.g. toWorld) to get proper coordinates for your light target point.

Mylenium

tcastudios
02-04-2006, 02:48 PM
Thanks. Getting closer! Using a test scene (a rotating Cube and moving Camera) things look as they should applying a layer "smacked" to one side of the Cube.
As of now (in the "real" scene) it looks more of a precision issue. There is a small "slide" of rotation as the object (the screen of a Ipod) is getting closer to the Camera.
Will go thru/redo the Cinema scene to see what it might be.


Cheers
Lennart

tcastudios
02-05-2006, 03:59 PM
Just to confirm. In Cinema the Light was refered to a object the was slightly offset.
Nulling it out gave a perfect match in AE only using the "Whip" from the new Layer to the Light(Parenting), also nulling the position and rotation of it in AE.

Thanks again for your help.

Cheers
Lennart

CGTalk Moderation
02-05-2006, 03:59 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.