ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Joe Richardson
Using a Text layer to point to any slider's value in a project
on Aug 26, 2019 at 2:28:37 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;


Return to posts index

Dan Ebberts
Re: Using a Text layer to point to any slider's value in a project
on Aug 26, 2019 at 7:39:33 pm

This seems to work:

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


Dan



Return to posts index

Joe Richardson
Re: Using a Text layer to point to any slider's value in a project
on Aug 27, 2019 at 4:26:36 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]