FORUMS: list search recent posts

accessing sub-composition property

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Adelbert Weidler
accessing sub-composition property
on Sep 24, 2012 at 1:58:15 pm

Hi, I have a wheel comp, within a layer "rim"

Now, the rim, nothing else, shall rotate to the x-position of the wheel.
So I tried to add the following script to the position-properties of the wheel-layer in wheel's parent-composition.
720 is the circumference of the wheel in px.

var r = (transform.position[0] / 720 * 360)/(180/Math.PI); // rad
thisComp.layer("wheel").layer("rim").transform.rotation = r; // I guess I can't stack layer-properties? but what then?
value + [0,0]; // If I dont do this, it causes a dimension-exception


I haven't figured out yet if the math is correct or if I need rotation or radiants. So far I just can't get access to the rim-layer in the wheel-composition.

How can I do that?

Thank you, guys.


Return to posts index

Dan Ebberts
Re: accessing sub-composition property
on Sep 24, 2012 at 3:18:55 pm

It looks like you're trying to control rotation from a position expression. If so, that won't work--the expression needs to be on the rotation property itself (an expression can only affect its host property, nothing else).

So your calculation would be something like:

360*(wheel's x distance)/(wheel's circumference)

where:

(wheel's circumference) = (wheel's diameter)*Math.PI


Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]