ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

creating 'universal' variable within a comp

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Brady Baltezore
creating 'universal' variable within a comp
on Jun 3, 2020 at 6:02:51 pm

Hello,
I'm looking to expand on an expression.

I've got a large number of layers referencing the value contained within an expression slider on a control layer.
So when I change the value of that slider, each expression referencing it changes accordingly. No problem here.

What I'd like to do now is use another slider effect to create a value that I can then use to say, stagger the values of some of the individual layers.

frame lag, for an example:

thisComp.layer("layer_x").transform.rotation.valueAtTime(time-1*thisComp.frameDuration)

EXCEPT, instead of "time-1*thisComp.frameDuration" I'd like to be able to plug in the reference to an second expression slider.

Pardon my syntax but something along the lines of:
"time-(thisComp.layer("expressionControl").effect("variableSlider").value)*thisComp.frameDuration)

Can anyone point me in the right direction? I feel like it's possible but I'm going about it the wrong way.

Thanks!

B


Return to posts index

Andrei Popa
Re: creating 'universal' variable within a comp
on Jun 4, 2020 at 7:29:20 am

I just think you need to insert a ("Slider") before value.

time-(thisComp.layer("expressionControl").effect("variableSlider")("Slider").value)*thisComp.frameDuration)

However, I would do it like this, to be easier to read:

diff = thisComp.layer("expressionControl").effect("variableSlider")("Slider").value;
time-diff*thisComp.frameDuration;


Andrei
My Envato portfolio.


Return to posts index

Brady Baltezore
Re: creating 'universal' variable within a comp
on Jun 7, 2020 at 9:08:48 pm

Awesome, thanks for responding!


Return to posts index

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