ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Understanding layer/comp space transformation

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Robert Müller
Understanding layer/comp space transformation
on Jul 21, 2020 at 2:21:36 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 1000x1000) 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?


Return to posts index

Filip Vandueren
Re: Understanding layer/comp space transformation
on Jul 21, 2020 at 4:07:29 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)



Return to posts index

Dan Ebberts
Re: Understanding layer/comp space transformation
on Jul 21, 2020 at 4:11:00 pm

Try this:

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


Dan



Return to posts index


Robert Müller
Re: Understanding layer/comp space transformation
on Jul 22, 2020 at 12:19:17 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


Return to posts index

Filip Vandueren
Re: Understanding layer/comp space transformation
on Jul 22, 2020 at 1:09:28 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 ?



Return to posts index

Martin M. Klöckener
Re: Understanding layer/comp space transformation
on Jul 30, 2020 at 9:49:16 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


Return to posts index


Filip Vandueren
Re: Understanding layer/comp space transformation
on Jul 30, 2020 at 4:44:52 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



Return to posts index

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