Alex Printz
Forum Replies Created
-
It is because the [0] is used to call the first part of value, which in this case is an array. Value is the number that goes into the expression BEFORE the code. Value are the numbers that you can type in or arrow change initially, or rotate/reposition with the mouse. Position has 2 parts of a value (unless separated), rotation has 1, scaled has 2, opacity has 1, etc.
So we are saying “look at the initial position (value). Only pay attention to the X part of that input array (value[0]). Now build that into a new output array ([value[0], ]…), But for the second part (Y), just be this particular number:999 ([value[0],999]).
If you say [20,50], you’re telling the output to just be 20X, and 50Y. Ignore value all together.
The brackets are used to build or reference arrays (in this case, value). You are building a new array as an output to replace the original one (value). Note that if you try to put a single output (eg, ‘100’ or [100]), you will get an error saying the system is expecting a number of two dimensions (2 units long of an array, or [X,Y])
-
No, the brackets around 0 are for declaring the initial value for X.
Something like scale the property requires two different values (X and Y).
It is declared with an array, like this [X,Y].
Arrays separate cells with a comma between elements.if you wanted to reference the initial value, it would be ‘value’, or, you could expand it like this:
[value[0],value[1]]
The brackets at the end of a variable (value here) tell it to look at the first cell of the array.
Which would declare creating a new array, using value[array0],value[array1]. Arrays always start at integer 0.So, first we need an array for scale:
[
then, we want to access the initial value where x is stored:
[value[0]
add a comma to declare the end of cell value 0, and beginning cell value 1:
[value[0],999]That's it!
You could also do something more complex as well, such as:
[value[0]/10,(value[0]*1.5)+value[1]]So really, the brackets are just for declaring something is an array.
-
set 999 to whatever you want it to be locked to.
[value[0],999] -
Alex Printz
June 25, 2018 at 3:31 pm in reply to: Trying to Bounce a Ball Using an Expression and SlidersTook me a minute to notice, but the variable freq has .MathPI used in one of the expressions, and not in one of the others.
layer = effect("Control Layer")("Layer");
freq = layer.effect("Bounce Freq")("Slider");
iniHi = layer.effect("Bounce Initial Height")("Slider");cos = iniHi*Math.cos(freq * Math.PI *time);
abs = Math.abs(cos)*-1;numBounces = Math.floor(freq*(time-.5))+Math.ceil(freq/2);
d = layer.effect("Bounce Decay")("Slider")/100;
decay = Math.pow(d,numBounces);linear(abs,-iniHi,0,-clamp(iniHi*decay,0,10000),0)+value
-
Alex Printz
June 25, 2018 at 2:21 pm in reply to: Technique for zooming in and stroke width remaining constantPlace the islands’ path inside another group layer (lets name it “Map”) while the stroke remains outside and below the subgroup “Map”.
Instead of animating the camera or the layer properties (which would also scale the stroke thickness proportionately), animate the transform values of the “Map” subgroup. That way the path gets bigger inside the subgroup, but the stroke remains the same. -
Dan, I like the using inPoint as the beginning of the search, that’s an efficient touch.
-
Alex Printz
June 22, 2018 at 1:55 pm in reply to: Find how many layers with the same name there are in the comp?I mean, expressions run on javascript, so I used a lot of javascript library reference and tutorials for learning.
It really just comes down to knowing what your target goal is, what resources you have available, and then how to build that bridge. I would suggest you read a lot of Dan’s site, particularly the bottom part where he highlights and explains what his code does.
I learned from mostly writing expressions myself out of project demands, and just a lot of searching and reading (and note taking!)
-
I don’t think it’s going to be as simple as you are expecting. Expressions have to be re-run each frame and cannot carry over variables between frames.
You would need to be doing a recursive search for each frame that happened prior to the current frame to check for when y>1000, and then from that frame linear forward 2 seconds.
-
Alex Printz
June 21, 2018 at 3:19 pm in reply to: Find how many layers with the same name there are in the comp?sure scott, all you would do is search until i < thisLayer.index instead of i <= thisComp.numLayers.
Then it would stop at the current layer.
-
I don’t believe you have access to the character panel values via expression, but I might be wrong.
I think you can only control the text animator functions, so your going to have to work with multiple boxes for typeface and opacity to show/hide, and anchorPoint/scale for sizing.