Copy link to clipboard
Copied
I'm working on a geometry rig that's pretty interwoven in null objects with 10-20 expression controls on each and I'm finding that it's real easy to get all tangled up. Problem is that my default values for things aren't always 0, sometimes they're opacity sliders (and odd numbers like 33, etc.) and it'd be infinitely helpful to know if I can manually write in an expression to determine the Reset value for each, that way if I'm all turned around I can rely on quick clicks on the Reset column for entire lists.
I could offset all my input values so that it would return as 0 when reaching the null object's expression controls, but I'd rather keep my own values because it's less confusing for me.
Is there an expression I could put inside a given expression control to determine the Reset value?
if (value==0) 30 else value
Any time the value hits zero it will be reset to 30, or whatever number you want, if it is not 0 as in reset then the value will what the slider is set to.
It might be better to think about creating an animation preset, or several of them. I have about 200 dedicated to animating motion that I use almost every day and only about a half dozen rely on keyframes. The rest use the in and out points of a layer to activate motion. Most of them have sliders and check boxes that
...Copy link to clipboard
Copied
if (value==0) 30 else value
Any time the value hits zero it will be reset to 30, or whatever number you want, if it is not 0 as in reset then the value will what the slider is set to.
It might be better to think about creating an animation preset, or several of them. I have about 200 dedicated to animating motion that I use almost every day and only about a half dozen rely on keyframes. The rest use the in and out points of a layer to activate motion. Most of them have sliders and check boxes that control timing. Here is an example of an animation preset that adds sliders to a layer, makes the layer fly in from the left, bounce to a stop, then fall out of the frame based on the in and out point. If you position the layer in it's "here" (resting) position, set the in and out point, then add the animation preset your work is done on that layer. This makes things like dynamic text animation a snap. Here's the preset: Dropbox - flyInBounceDropOut.ffx
Here's the expression:
sif = effect("slideIn Frames")("Slider");
sof= effect("slideOut Frames")("Slider");
// find in and out point
inTime = sif * thisComp.frameDuration;
if (effect("Match SI SO")("Checkbox") == 0) {
outTime = sof * thisComp.frameDuration;
}
else if (effect("Match SI SO")("Checkbox") == 1) {
outTime = inTime;
}
// Fix layer size when scaled
sf = scale - [100, 100];
xSize = width + (width * sf[0]/100);
ySize = height + (height * sf[1]/100);
realSize = [xSize, ySize];
// Set Positions
spx = 0 - realSize[0] + realSize[0]/2 ;
rstx = value [0];
rsty = value[1];
epy = thisComp.height + realSize[1] - realSize[1]/2;
// create movement
freq = effect("bounce Frequency")("Slider");
amplitude = effect("bounce Amplitude")("Slider");
decay = effect("bounce Decay")("Slider");
posCos = Math.abs(Math.cos(freq*time*2*Math.PI));
nt = time-inPoint;
y = amplitude*posCos/Math.exp(decay*nt);
moveIn = Math.min(linear(time,inPoint,inPoint + inTime,spx ,rstx-y));
moveOut = Math.min(easeIn(time,outPoint - outTime,outPoint - thisComp.frameDuration,rsty ,epy));
[moveIn, moveOut]
It's a good idea to put your custom expressions in a shared Dropbox folder or shared cloud folder and then create an alias to them in the standard folder for your custom shortcuts so they are available on any machine you use at any time and so you can browse them in the effects and presets panel.
Copy link to clipboard
Copied
Thank you so much! I just started using expressions (excluding the plain "parent to value" pickwhip) about two weeks ago. I love your ideas about presets and Dropbox, as well as the code you posted. I'm definitely going to comb through it to figure out how you did what you did. Cheers!