Monday 28 January 2013

Effect Tracks Parented Layer


Effect Tracks Parented Layer

To start, consider a relatively simple example: You have
a layer named star that’s the child of another layer, and
you want to rotate the parent, causing the child to orbit
the parent. You have applied CC Particle Systems II to a
comp-sized layer and you want the Producer Position of
the particle system to track the comp position of the child
layer. The expression you need to do all this is
L = thisComp.layer("star");
L.toComp(L.transform.anchorPoint)
The fi rst line is a little trick I like to use to make the following
lines shorter and easier to manage. It creates a variable
L and sets it equal to the layer whose position needs to be
translated. It’s important to note that you can use variables
to represent more than just numbers. In this case the variable
is representing a layer object. So now, when you want
to reference a property or attribute of the target layer,
instead of having to prefi x it with thisComp.layer("star"),
you can just use L.
In the second line the toComp() layer space transform
translates the target layer’s anchor point from the layer’s
own space to comp space. The transform uses the anchor
point because it represents the layer’s position in its own
layer space. Another way to think of this second line is
“From the target layer’s own layer space, convert the target
layer’s anchor point into comp space coordinates.”
This simple expression can be used in many ways. For example,
if you want to simulate the look of 3D rays emanating

from a 3D shape layer you can create a 3D null and make
it the child of the shape layer. You then position the null
some distance behind the shape layer. Then apply the CC
Light Burst 2.5 effect to a comp-sized 2D layer and apply
this expression to effect’s Center parameter (Figure 10.9):
L = thisComp.layer("source point");
L.toComp(L.anchorPoint)
(Notice that this is the same expression as in the previous
example, except for the name of the target layer: source
point, in this case). If you rotate the shape layer, or move a
camera around, the rays seem to be coming from the position
of the null.




No comments:

Post a Comment