Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Understanding layer/comp space transformation

  • Understanding layer/comp space transformation

    Posted by Robert Müller on July 21, 2020 at 2:21 pm

    Hi, Im trying to wrap my head around layer and composition space transformation but I’ve run into a problem.I have this scenario:
    I have a main composition (“main_01”, dimension 1000×1000) which holds a nested precomp (“nested_01”, dimension also 1000,1000. But the precomp is scaled down by 50%). In the precomp there is an image with a point-controll based effect, like page turn or light sweep. Since I want to controll everything from my main comp I added a point control on the precomp layer to drive the effect. Now Im trying to get the right arrangement of “toComp”‘s to drive the effect from my Main comp but I’ve had no luck so far. Any ideas?

    Filip Vandueren replied 5 years, 9 months ago 4 Members · 6 Replies
  • 6 Replies
  • Filip Vandueren

    July 21, 2020 at 4:07 pm

    Because you want to control the parameter of the subcomp from a master-comp, I would “Add property to Essential Graphics”. the point now becomes a master property of the precomp.
    This has the huge benefit that hte comp can be re-used in mulitple “master”-comps that can have different settings.

    Now to drive that Master property from say, the position of a Null object, give it this expression:

    fromComp(thisComp.layer("Null 1").transform.position);

    (Assuming the Null is not parented to anything)

  • Dan Ebberts

    July 21, 2020 at 4:11 pm

    Try this:

    L = comp(“main_01”).layer(thisComp.name);
    fromComp(L.effect(“Point Control”)(“Point”))

    Dan

  • Robert Müller

    July 22, 2020 at 12:19 pm

    Thanks for the replies guys, but this didnt seem to work. Ive tried some more with just the positions of a null object driving an object in a scaled down precomp but its still offset. Ive attached a screenshot to illustrate the problem. The green mask on “comp2” is just to show you where the bounding box of the composition would be if I would switch collapse transformation off

  • Filip Vandueren

    July 22, 2020 at 1:09 pm

    Yes, rather unhelpfully: After Effects Coördinates system is totally thrown out for collapse geometries…

    this is the most robust solution I can think of, that should be immune to Parenting, Collapsing transformations, mixing and matching of 2D- and 3D-layers etc.


    null_layer = comp("main_01").layer("Null 1");
    my_layer = comp("main_01").layer(thisComp.name);

    myPos = my_layer.fromCompToSurface( null_layer.toComp(null_layer.anchorPoint) );

    if (thisLayer.hasParent) myPos = parent.fromWorld(myPos);

    But maybe Dan has some insights on how this could be done more simply ?

  • Martin M. Klöckener

    July 30, 2020 at 9:49 am

    I faced the same challenge today and came up with quite a neat solution. The idea is to use Graphic Essentials, so the precomp can be used in multiple instances and thus the point control is always dynamic.
    This solution also takes care of all parenting and transformations.

    You basically have to expose the Point Control of your effect (ie Light Sweep) to Graphic Essentials and then have a small expression in the main comp that converts the world space coordinates to layer coordinates.

    As it’s a bit complicated to explain, I’ll just attach an AE-document with an example. Hope it helps! ☺

    14234_pointcontrolexample.aep.zip

  • Filip Vandueren

    July 30, 2020 at 4:44 pm

    Hi Martin,

    yes this is what I was talking about in post#2,
    but this solution breaks if collapse transformations is enabled on the precomp

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy