Slider Control Syntax Question

Moderators: Disciple, zlovatt

Post Reply
TheChangeCo
Posts: 4
Joined: June 14th, 2012, 7:39 am

I have a template that uses sliders to control other elements, I was just wondering why it has to be called "ADBE Slider Control-0001". Why the -0001? Any help would be greatly appreciated, thanks!


CONTEXT:
100-thisComp.layer("Data point 01").effect("Data Point 01")("ADBE Slider Control-0001")
dfred
Posts: 29
Joined: July 23rd, 2010, 11:49 pm

If you are using AE in English you can just use ("Slider") instead.

"ADBE Slider Control-0001" is the matchName of the actual slider--meaning that no matter what language AE is being used in that matchName will always reference that part of the effect--it is hardcoded into the program. Whereas the word "Slider" could change depending on the language. If there was a second slider inside of the effect (which is not the case) it would be "ADBE Slider Control-0002", etc. It's a way of universalizing the expression. There are many ways to write an expression and that is one of them. These would all work:

Code: Select all

thisComp.layer("Data point 01").effect("Data Point 01")("Slider")                              // here we use the English name "Slider
thisComp.layer("Data point 01").effect("Data Point 01")("ADBE Slider Control-0001")           // here we use the hard-coded matchName
thisComp.layer("Data point 01")("Effects")("Data Point 01")("Slider")
comp("NAME OF COMP GOES HERE").layer("Data point 01").effect("Data Point 01")("Slider")
If your layer was the first layer and your slider effect was the first effect on the layer these would work--only good if you don't change the order of layers/effects:

Code: Select all

thisComp.layer(1)("Effects")(1)("Slider")                                                                   // layer(1) means the first layer, ("Effects")(1) means the first effect in the effects group on the layer
thisComp.layer(1).effect(1)("Slider")                                                                       // a different way of writing ("Effects") is .effect
thisComp.layer(1)("ADBE Effect Parade")(1)("ADBE Slider Control-0001")
And there are more combinations than the ones listed above.
TheChangeCo
Posts: 4
Joined: June 14th, 2012, 7:39 am

Thank you so much for the clarification! I am pulling these templates apart trying to figure out how they work and this is extremely helpful! Thanks again!
TheChangeCo
Posts: 4
Joined: June 14th, 2012, 7:39 am

One more question. What is the meaning of "temp" in this context:

temp = thisComp.layer("enter percent here").effect("enter percent here")("ADBE Slider Control-0001");
[100, temp]


Thanks in advance for the help! Just starting to wrap my head around expressions!
dfred
Posts: 29
Joined: July 23rd, 2010, 11:49 pm

"temp" is the name of the variable. On the first line "temp" was assigned the value of the slider, so let's say the slider is set to 50.

The second line is the final expression that is calculated, which would be [100, 50].

So, if the expression is on "Scale" it would assign 100% to the x scale and 50% to the y scale.

You could rename "temp" to be "new_y_scale" or whatever you want, but you would need to change it in both the first and second lines. "temp" is just AE's default variable name.
TheChangeCo
Posts: 4
Joined: June 14th, 2012, 7:39 am

Thanks so much! Getting easier by the minute!
Post Reply