Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expressions – Question about actual and relative path

  • Expressions – Question about actual and relative path

    Posted by Anja Riehl on January 20, 2017 at 12:08 pm

    Hello there,

    I am using the expression below, but somehow the way I did it, isn´t working for me.
    Is there a way to use relative paths?
    Can anyone help? This would make my day 🙂

    comp("SCENES 1-10").layer("CAM ctrl").transform.yRotation;
    C = comp("SCENES 1-10");
    L = C.layer("POPUP PAGE 3");
    C.layer("CAM ctrl").transform.yRotation.valueAtTime(time+L.startTime)

    Anja Riehl replied 9 years, 3 months ago 2 Members · 8 Replies
  • 8 Replies
  • Dan Ebberts

    January 20, 2017 at 6:37 pm

    What is it you’re trying to do? The way you have it written, it doesn’t appear that the first line will do anything.

    Dan

  • Anja Riehl

    January 22, 2017 at 4:10 pm

    Hello, my CAM ctrl layer is connected to the CAM ctrl layer in the main composition. That is what the line is for. What I’ll need is my script with a relative path.

  • Dan Ebberts

    January 22, 2017 at 6:21 pm

    Sorry, I don’t know what you mean by “relative path”.

    Dan

  • Anja Riehl

    January 22, 2017 at 6:43 pm

    Let me explain…

    At the moment I am using an expression like that:
    L = C.layer(“POPUP PAGE 3”)
    With an actual path “POPUP PAGE 3″…is there a way to generalize this?
    The “POPUP PAGE 3” composition is part of the Main Composition, so a level above.
    Do you need more information?

    Thank you.
    Anja

  • Dan Ebberts

    January 22, 2017 at 6:50 pm

    You could do this:

    L = C.layer(thisComp.name)

    but you can only reference the main comp by name, if that’s what you’re asking.

    Dan

  • Anja Riehl

    January 22, 2017 at 7:42 pm

    Ok, this is the expression that I am using. (below)..so I can only change the general path for the second line? Can I work with “_parent”?
    C = comp(“SCENES 1-10”);
    L = C.layer(“POPUP PAGE 3”);
    C.layer(“CAM ctrl”).transform.yRotation.valueAtTime(time+L.startTime)

    Sorry, for sounding so weird. I am an absolute beginner when it comes to scripting with AE.
    It’s such an amazing and complex program.
    Thank you so much for your time and help.

    Anja

  • Dan Ebberts

    January 22, 2017 at 8:24 pm

    There is no way to access the “parent” comp, except by name.

    That’s by design, because a precomp only renders once–you can’t have a precomp render differently based on what parent crop you drop it into.

    Dan

  • Anja Riehl

    January 23, 2017 at 12:07 am

    Ok, Thank you so much for your help Dan.
    Anja

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