Nubby NinjaKeymasterApril 23, 2018 at 12:18Post count: 13
Wiggle.aep contains 3 comps.
I started with the simplest version.
Select the layer you want to want to affect, hold ALT and click the property you want to apply the wiggle() expression to.
2 being the frequency, or times-per-second to wiggle.
50 being the amplitude, or amount to move (in this case, pixels).
This worked. I wanted more control though. So, I separated the X and Y position.
“org” is x
“temp” is y
I gleaned this from elsewhere on the internet, but I don’t recall the original source. Feel free to leave a comment with that info and I’ll be sure to add it to the Project.
org=value; temp=wiggle(2,40); [temp,org]
So far we’ve assigned the wiggle() expression to only affect the y position.
Now, I want a little more control over the different values in the wiggle() expression.
You might find similar code out there, but this I crafted myself:
x=value; y=wiggle(thisComp.layer("Shape Layer 1").effect("Y-Wobble Frequency")("Slider"),thisComp.layer("Shape Layer 1").effect("Y-Wobble Amplitude")("Slider")); [y,x]
So x is assigned whatever value you leave it at. So “value;” accounts for this.
The y position is assigned the wiggle() expression, but instead having to go back and change the frequency and amplitude from the expression itself (adding the risk of fudging the script each time) I connected both values to sliders. (expression controls).
At the end of the code, we assign the the variables X and Y to the different position values. That part is required for the code to function, otherwise the expression will point to nowhere.
Often in various programming / scripting languages, the first iteration when referring to any object, parameter or property in-sequence is 0… the second is 1, and so on.
So since Position in After Effects starts with y, it gets a value of 0 (zero) and since x is the next iteration, it gets a value of 1.
This is the order of things. Believe me, it took a few minutes for my brain to break out of the X then Y mentality. When in Rome.
Attachments:You must be logged in to view attached files.
- You must be logged in to reply to this topic.