Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions LINKING EXPRESSIONS ACROSS COMPS (timing issue)

  • LINKING EXPRESSIONS ACROSS COMPS (timing issue)

    Posted by Garrett Perkins on February 2, 2016 at 8:47 pm

    Ok, this is my first post and I look forward to your help.

    I have a master comp which contains 3 precomps. I have currently linked a position expression in the main comp to a controller slider in one of the precomps. That worked fine. However now the text layer in the comp doesn’t move with the controller keyframes in the precomp. It appears as if the action took place way earlier in the text layer. I know this has something to do with time but I don’t know how to fix it. Here is the expression I have on the text layer:

    Thanks,
    Garrett

    y=comp("Section 3").layer("Controller").effect("Y AXIS MOVER")("Slider");
    [value[0],value[1]-y]

    Garrett Perkins replied 10 years, 7 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    February 2, 2016 at 9:35 pm

    I think it’s going to look something like this:

    y=comp(“Section 3”).layer(“Controller”).effect(“Y AXIS MOVER”)(“Slider”);
    L = thisComp.layer(“Section 3”);
    [value[0],value[1]-y.valueAtTime(time-L.startTime)]

    Dan

  • Garrett Perkins

    February 2, 2016 at 11:12 pm

    Dan,
    That totally works! One further question. If I need to modify the value of y (by adding another variable) it tells me the that it is not a function. Why is that. Example:

    I realize I’m probably just missing something here

    Thanks,
    Garrett

    y=comp("Section 3").layer("Controller").effect("Y AXIS MOVER")("Slider");
    L = thisComp.layer("Section 3");
    x=y*1.5;
    [value[0],value[1]-x.valueAtTime(time-L.startTime)]

  • Dan Ebberts

    February 2, 2016 at 11:22 pm

    It’s a little confusing. Technically, y is an object that represents the slider. But when you do x=y*1.5, y is interpreted as being the current value of the slider and x is 1.5 times that number. So x is a number, which means that x.valueAtTime makes no sense to the expression engine. This would work:

    x=1.5;
    [value[0],value[1]-x*y.valueAtTime(time-L.startTime)]

    Dan

  • Garrett Perkins

    February 2, 2016 at 11:31 pm

    That makes perfect sense. Thanks so much your help!

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