Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects toComp puppet pin to 2Dnull irrespective of puppeted comp size

  • toComp puppet pin to 2Dnull irrespective of puppeted comp size

    Posted by Alex Ezorsky on September 7, 2019 at 6:24 pm

    I’m trying to experiment with putting a pattern on someone’s face and I’ve got tracking data for all the face points we need in the form of position animated nulls.

    I have the pattern comp with puppet pins placed but it’s not the same size as the main comp so I figured I could do the whole toComp() thing to parent pins to nulls but even though the expression doesn’t give errors the positioning of the puppet pin is still wildly far from the null.

    I tried toWorld also. Any ideas?

    Dan Ebberts replied 6 years, 11 months ago 3 Members · 4 Replies
  • 4 Replies
  • Graham Quince

    September 8, 2019 at 7:29 am

    Try pre-comping your pattern comp into a comp with the same dimensions and then apply the puppet pins to that, rather than directly onto the differently sized pattern comp.

    I think that should do it.

    http://www.YouTube.com/ShiveringCactus – Free FX for amateur films
    https://shiveringcactus.wordpress.com/ – FX blog

  • Dan Ebberts

    September 9, 2019 at 5:50 pm

    You might need fromComp(), like this:

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

    Dan

  • Alex Ezorsky

    September 10, 2019 at 2:50 am

    This is amazing Dan it works like a charm allowing me to scale move and even rotate the source and the pin’s stay put on the screen!

    I’d never heard of the .fromComp before. The only tutorial I could find online about fromComp is this which helps but is too short https://www.youtube.com/watch?v=CT5sq2APfzA

    Do you know any better tutorials for this?

    Also I’m trying to figure out why the anchor point being the reference makes it all work. I’ve noticed changing that to the layer’s “position” definitely does not work, which I find odd because wouldn’t AE need to know the layer’s position on the screen in order to compensate?

    Thanks!

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

  • Dan Ebberts

    September 10, 2019 at 6:17 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

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