Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions referencing from a lower comp

  • referencing from a lower comp

    Posted by Kari Pieskä on April 28, 2013 at 8:24 pm

    I have a maincomp with a character. Then I have a pre-comp “eyes”. In “eyes” comp I have pupils that I want to be able to control on the maincomp.
    I make a null_1 on “eyes” layer and parent pupils to the null_1.

    I make a null_2 on the maincomp and make an position expression on null_1 to use null_2 position.

    It all works good, I am able to control pupils on the maincomp. But if I change the size of the maincomp, the pupils fall out of place.

    Why is this?

    I could put the eyes and pupils and the rest on the maincomp, but I have quite few objects on the eyescomp, so it seems cleanest to keep them on a precomp. Also because I want to control the opacity with eyecomps own opacity and with masks.

    I’d like to know why this falling out of place occurs. Or if there are any other solutions, I’d be happy to know them. Or any tutorials touching this same subject?

    Kari Pieskä replied 13 years, 3 months ago 3 Members · 3 Replies
  • 3 Replies
  • Thor Sarup

    April 28, 2013 at 8:43 pm

    thats because the size of the nested isn’t changed automatically when the parent comp is.

    You could fix it by multiplying the size difference of the comps (ratio) by adding the folowing expression to the null in the pre-comp:

    mainPos = comp("mainComp").layer("Null 1").transform.position;
    compRatio = thisComp.width / comp("mainComp").width;

    mainPos * compRatio;

  • Dan Ebberts

    April 28, 2013 at 9:07 pm

    I think you need to use layer space transforms to account for the difference in comp sizes. The expression for “null_1” in your pre-comp would look something like this:

    C = comp(“maincomp”);
    L = C.layer(thisComp.name);
    N = C.layer(“null_2”);
    L.fromComp(N.toComp(N.anchorPoint))

    Dan

  • Kari Pieskä

    April 29, 2013 at 8:25 am

    Dans expression seems to work. Though it seems simple, I’m having hard time to understand it throughly. But, it works and for now it’s enough.

    Thank you both!

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