Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expressions in Precomp React to Value of Slider in Main Comp

  • Expressions in Precomp React to Value of Slider in Main Comp

    Posted by Isaac Carlson on December 10, 2018 at 6:31 pm

    I’m hoping to get some help with a project I’m working on. This one is a bit difficult to explain. I have a series of precomps in a master composition. Each precomp has animated text layers. Each text layer is pulling the source text from a .csv file. The cell # (from the csv) that the text is pulled from is determined by a slider control in the main comp. That slider control has an if/else expression that makes the value determined by the inpoints of layers on the main comp.

    The idea is basically to “auto-generate” animated titles from a CSV file. The csv file contains the text, which is pulled into the text layers in After Effects, with the title number determined by a control layer with a slider control in the main comp. Since the slider control is determined by in points it automatically determines the title number based on which layer the playhead is over in the main comp.

    This has worked great when all the layers are in one comp, but it falls apart when the text files are in the precomps. As best I can diagnose, it seems like this is because the text files are looking at the slider control value based on the position of the precomps own playhead, as opposed to the position of the playhead in the main comp. This means it always reads the slider control value as “0”, no matter at what point the playhead is in the main comp.

    Is there any crafty way to tell the text layers to determine their value based on the slider control value at the main comp’s playhead? Or am I asking too much of the software? Any advice and guidance is hugely appreciated. I am just beginning to muck about with expressions. Thanks!

    Jonathan Lutjens replied 7 years, 5 months ago 3 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 10, 2018 at 7:29 pm

    Your expression needs to adjust the time by the amount of the start time of the precomp layer in the main camp. A straightforward case will end up looking something like this:

    C = comp(“main comp”);
    ctrl = C.layer(“controls”).effect(“Slider Control”)(“Slider”);
    L = C.layer(thisComp.name);
    ctrl.valueAtTime(time + L.startTime)

    If you have multiple levels of nesting or any time remapping involved, it can get complex.

    Dan

  • Jonathan Lutjens

    February 8, 2019 at 8:00 pm

    Scouring the webs for expression help and as is so often the case, the solution was posted by Dan. I’ve benefited from your knowledge and generosity for years. Thank you!

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