Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using a Text layer to point to any slider’s value in a project

  • Using a Text layer to point to any slider’s value in a project

    Posted by Joe Richardson on August 26, 2019 at 2:28 pm

    I wanted to use one text layer to point to any comp, layer and effect (slider) for another text layer’s value within a project.

    I was wondering if I could use a text layer as part of the expression to tell after effects which composition name and layer to get the slider value from.

    I’ve managed to get everything working, but AE evaluates the result as a text layer, instead of the actual Slider-Value.

    i managed to do it by basically telling it to do part1+part2+part3+part4 and displaying the result. As I mentioned, it displays the path to the comp, the layer, the effect, and the name “Slider”, instead of the slider’s value.

    I tried using $.evalFile, but I got the same results (AE displays the path instead of the value of that slider)

    Sorry this is a really confusing question.

    pointer = thisComp.layer("Pointer")("Text")(Source Text");
    part1 = """comp("""";
    part2 = """").layer("""";
    part3 = """_Value").effect("""";
    part4 = """_Driver_Value("Slider").value""";
    val = part1 + pointer + part2 + pointer + part3 + pointer + part4;

    Joe Richardson replied 6 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 26, 2019 at 7:39 pm

    This seems to work:

    pointer = thisComp.layer(“Pointer”).text.sourceText.value;
    comp(pointer).layer(pointer).effect(pointer + “_Driver_Value”)(“Slider”).value

    Dan

  • Joe Richardson

    August 27, 2019 at 4:26 am

    Thanks for the answer! All that was missing was the “_Value” after the “layer(pointer)”, but it works!

    Yesterday’s workaround was using a long else if statement for the value and a Slider Control. So the comp, layer and slider are based on numbers. That way, I just change the slider’s value, and it points to different comps and whatnot for the text layer’s value.

    but, thank you. I had no idea how to get AE to evaluate it as a pointer instead of just text.

    pointer = thisComp.layer("Pointer").text.sourceText.value;
    comp(pointer).layer(pointer + "_Value").effect(pointer + "_Driver_Value")("Slider").value

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