ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: toComp puppet pin to 2Dnull irrespective of puppeted comp size

COW Forums : Adobe After Effects

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Dan Ebberts
Re: toComp puppet pin to 2Dnull irrespective of puppeted comp size
on Sep 10, 2019 at 6:17:39 am

The layer space transforms are all about getting points from layer space to comp space (toComp) and from comp space to layer space (fromComp).

The first part of the expression needs to get the null's location into comp space. If the null is not parented, you can skip toComp and just use its position, like this:

p = thisComp.layer("Null 1").position;
fromComp(p)

If the null is parented, then its position is no longer represented in comp space (it's actually in the parent's layer space) so you need to covert the null's anchor point (which is always represented in the null's layer space) from layer space to comp space:

L = thisComp.layer("Null 1");
p = L.toComp(L.anchorPoint);
fromComp(p)

Note that is solution will work whether or not the null is parented (which is why I did it that way).

Puppet pins are represented in layer space, so unless the layer with the pins is comp-sized, centered on the comp, and not scaled or rotated, you need to translate the null's location in comp space to the layer pin layer's layer space, which requires fromComp.

I hope that helps.


Dan



Posts IndexRead Thread 


Current Message Thread:





© 2019 CreativeCOW.net All Rights Reserved
[TOP]