ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Linking opacity values with expressions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Brian Parchim
Linking opacity values with expressions
on Nov 7, 2019 at 10:43:15 pm

I have a graphic that has "Step 1", "Step 2".... along the bottom to show the steps of an installation. The opacity of the text will be 50% until it is on that step. When it's time for STEP 1, there is a red box behind the text with 100% opacity. When the video goes to STEP 2, I want STEP 1 opacity to drop to 50% and the red box to 0%, and at the same time, STEP 2 opacity to go from 50% to 100% and the red box below that text to go from 0 to 100%.

Is there a way to do this with expressions so I can easily do multiple steps with few keyframes? I currently don't know how many steps I will have in the final product. I wanted to use this across multiple videos so the amount of steps would change.



Return to posts index

Dan Ebberts
Re: Linking opacity values with expressions
on Nov 7, 2019 at 10:59:33 pm

There are a lot of ways to do it. One would be to control everything from a single slider. The the step layers would have names like "1. Step" or "1. Background" and have an opacity expression like this:

curStep = Math.round(thisComp.layer("Control").effect("Slider Control")("Slider"));
myStep = parseInt(name,10);
curStep == myStep ? 100 : 50

So each layer's name would begin with its corresponding step number.

The last line of the expression would be like this for the background layers:

curStep == myStep ? 100 : 0


Dan



Return to posts index

Brian Parchim
Re: Linking opacity values with expressions
on Nov 8, 2019 at 3:06:51 pm

Thanks Dan. That works great! Is there a way, instead of just switching to the next step, to have it fade between steps?


Return to posts index


Dan Ebberts
Re: Linking opacity values with expressions
on Nov 8, 2019 at 4:05:00 pm

You could control that with the slider as well, like this:

curStep = thisComp.layer("Control").effect("Slider Control")("Slider");
myStep = parseInt(name,10);
d = Math.abs(curStep-myStep);
ease(d,0,1,100,50)


Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]