Activity › Forums › Adobe After Effects Expressions › source text to slider control
-
source text to slider control
Posted by Milos Milunovic on February 8, 2015 at 4:58 pmHi,
I’m working on a project and I need to link a source text with a slider control. Layer with text (source text) is in one composition and null layer with slider control in other compositon. basically when a type 1 in text layer I want the slider control to change to 1, 2 to 2…
I try with pick whip but nothing hapends? Do I need tu use some expressions?
of course I’m beginner in expressions 🙂
can someone help?Azariy Krutin replied 4 years, 9 months ago 5 Members · 9 Replies -
9 Replies
-
Dan Ebberts
February 8, 2015 at 5:30 pmSomething like this maybe:
txt = comp(“Text Comp”).layer(“Text Layer”).text.sourceText;
if (! isNaN(parseFloat(txt)))
parseFloat(txt)
else
valueDan
-
Milos Milunovic
February 9, 2015 at 1:34 pmThanks Dan, it worked!!!
one more question:
i have a Text layer, one pre-comp and one null layer in my composition. Text layer (source text) is controling the null layer with slider control where I put your expression. On precomp I added a time remap and a expreesion:
state=thisComp.layer(“Null 72”).effect(“odelo”)(“ADBE Slider Control-0001”);
framesToTime(state);.When I type 1 in text layer slider from null layer goes to frame number 1 of pre-comp.
Question is:
is it possible to manual control the slider? to add a Checkbox Control or something like that? basically I want to use slider control who has a expression and type a number. currently can not because of the expression.
Thanks again for help. -
Dan Ebberts
February 9, 2015 at 2:36 pmThis version will take the value of the text layer if a checkbox is on, otherwise it will take the value you enter for the slider:
if (effect("Checkbox Control")("Checkbox").value){
txt = comp("Text Comp").layer("Text Layer").text.sourceText;
if (! isNaN(parseFloat(txt)))
parseFloat(txt)
else
value
}else
value
Dan
-
Brian Holzknecht
February 20, 2015 at 6:07 pmThis is awesome, I was just trying to do this the other day.
Thanks,
Brian Holzknecht
-
Detlef Maerz
August 13, 2021 at 1:56 pmHey Guys, how this expression should be written if i use it to control the scale parameter, wich is an array?
-
Dan Ebberts
August 13, 2021 at 7:16 pmTry replacing this:
if (! isNaN(parseFloat(txt)))
parseFloat(txt)
with this:
if (! isNaN(parseFloat(txt))){
s = parseFloat(txt);
[s,s];
}
Reply to this Discussion! Login or Sign Up