ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Slider to Play through keyframe data

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Marticus Kilverticus
Slider to Play through keyframe data
on Feb 10, 2020 at 3:04:50 pm

Hi all,

I'm animating flashing opacity effects which I want to happen across a slider 0-1.
So I have the flashing keyframe data (1-10 keys) on a separate layer's opacity.

How do I playthrough each keyframes data as the slider progresses through 0 - 1?

Thanks!


Return to posts index

Alex Printz
Re: Slider to Play through keyframe data
on Feb 10, 2020 at 8:41:42 pm

try this, just point the effect correctly to the proper slider

valueAtTime(linear(thisComp.layer("target layer").effect("Slider")(1),0,1,key(1).time,key(numKeys).time))

Alex Printz
Mograph Designer


Return to posts index

Marticus Kilverticus
Re: Slider to Play through keyframe data
on Feb 10, 2020 at 9:56:49 pm

It's good, thank you!

But I'm struggling to grab the keyframe information from a different layer when using the normal reference methods. How do I target my "opa" correctly in this instance below?

row = effect("Row")("Slider");
drop = thisComp.layer("CTRL").effect("Drop")("Slider");
thedrop = linear(drop,row-1,row,0,1); //converts row vs drop to 0 to 1
opa = thisComp.layer("Col A Row 1").transform.opacity //reference layers opacity

valueAtTime(linear(thedrop,0,1,key(1).time,key(numKeys).time))


Return to posts index


Alex Printz
Re: Slider to Play through keyframe data
on Feb 11, 2020 at 3:12:32 pm

I think it would be like this:

row = effect("Row")("Slider");
drop = thisComp.layer("CTRL").effect("Drop")("Slider");
thedrop = linear(drop,row-1,row,0,1); //converts row vs drop to 0 to 1
opa = thisComp.layer("Col A Row 1").transform.opacity //reference layers opacity

valueAtTime(linear(thedrop,0,1,opa.key(1).time,opa.key(opa.numKeys).time))


Alex Printz
Mograph Designer


Return to posts index

Marticus Kilverticus
Re: Slider to Play through keyframe data
on Feb 11, 2020 at 4:12:55 pm

Many thanks Alex!
That was nearly right, just needed another reference to the layer at the start! Phew! :D

opa = thisComp.layer("Col A Row 1").transform.opacity //reference layers opacity

opa.valueAtTime(linear(slider,0,1,opa.key(1).time,opa.key(opa.numKeys).time))


Return to posts index

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