Monday 28 January 2013

Apply 2D Layer as Decal onto 3D Layer


Apply 2D Layer as Decal onto 3D Layer

Sometimes you may need to use more than one layer space
transform in a single expression. For example, you might
want to apply a 2D layer like a decal to a 3D layer using the
Corner Pin effect. To pull this off you need a way to mark
on the 3D layer where you want the corners of the 2D layer
to be pinned. Apply four Point Controls to the 3D layer,
and you can then position each of the 2D layer’s corners
individually on the surface of the 3D layer. To keep things
simple, rename each of the Point Controls to indicate the

corner it represents, making the upper-left one UL, the
upper-right UR, and so on. Once the Point Controls are
in place, you can apply an expression like this one for the
upper-left parameter to each parameter of the 2D layer’s
Corner Pin effect:
L = thisComp.layer("target");
fromComp(L.toComp(L.effect("UL")("Point"))).

The fi rst line is just the little shorthand trick so that you
can reference the target layer (the 3D layer in this case)
more succinctly. The second line translates the position of
Point Controls from the 3D layer’s space to the layer space
of the 2D layer with the Corner Pin effect. There are no
layer-to-layer space transforms, however, so the best you
can do is transform twice: fi rst from the 3D layer to comp
space and then from comp space to the 2D layer. (Remember
to edit the expression slightly for each of the other
corner parameters so that it references the corresponding
Point Control on the 3D layer.)
So, inside the parentheses you convert the Point Control
from the 3D layer’s space into comp space. Then you convert
that result to the 2D layer’s space. Nothing to it, right?



No comments:

Post a Comment