ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

trigger animation with marker on a different layer

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nate Biehl
trigger animation with marker on a different layer
on May 30, 2019 at 4:02:16 pm

Hello,

I have an animation on a layer that works well with this expression:
L = thisComp.layer("Text Movement");
if ((L.marker.numKeys > 0) && (numKeys > 0)){
t1 = key(1).time;
t = Math.max(time - L.marker.key(1).time,0);
valueAtTime(t1 + t);
}else
value


I would love to be able to trigger another animation on another layer to the same marker so everything happens when I move the one marker. The problem I'm running into is I already have an expression governing the size of a shape layer:
if (numKeys > 1){
t1 = key(1).time;
t2 = key(2).time;
v1 = effect("Vertical Size 1")("Slider");
v2 = effect("Vertical Size 2")("Slider");
linear(time,t1,t2,v1,v2);
}else
value


Can anyone help me figure out how to get the keyframes set by the sliders in the second layer to animate when triggered by the marker in the first? The sliders are a real workflow saver, would like to keep them if possible.

Thanks

L = thisComp.layer("Text Movement");
if ((L.marker.numKeys > 0) && (numKeys > 0)){
t1 = key(1).time;
t = Math.max(time - L.marker.key(1).time,0);
valueAtTime(t1 + t);
}else
value


Return to posts index

Nate Biehl
Re: trigger animation with marker on a different layer
on May 30, 2019 at 8:20:25 pm

if you've read this and it's confusing, please let me know if there's something I could clarify. Thanks!


Return to posts index

Filip Vandueren
Re: trigger animation with marker on a different layer
on Jun 3, 2019 at 3:49:47 am

try this

L = thisComp.layer("Text Movement");
if ((L.marker.numKeys > 0) && (numKeys > 1)){
t1 = key(1).time;
t2 = key(2).time;
v1 = effect("Vertical Size 1")("Slider");
v2 = effect("Vertical Size 2")("Slider");
t = Math.max(time - L.marker.key(1).time,0);
linear(t,t1,t2,v1,v2);
}else
value




Return to posts index


Nate Biehl
Re: trigger animation with marker on a different layer
on Jun 3, 2019 at 2:38:11 pm

Thanks for the reply!
Unfortunately, nothing happens


Return to posts index

Filip Vandueren
Re: trigger animation with marker on a different layer
on Jun 3, 2019 at 8:04:10 pm

Sorry I didn't test the codeā€¦

This should work. But perhaps you'll need to change the [s,s] to [s,s,s] for a 3D layer.

L = thisComp.layer("Text Movement");
if ((L.marker.numKeys > 0) && (numKeys > 1)){
t1 = key(1).time;
t2 = key(2).time;
v1 = effect("Vertical Size 1")("Slider");
v2 = effect("Vertical Size 2")("Slider");
t = time - L.marker.key (1).time + t1;
s = linear(t,t1,t2,v1,v2);
[s,s];
}else {
value
}




Return to posts index

Nate Biehl
Re: trigger animation with marker on a different layer
on Jun 3, 2019 at 8:18:59 pm

So, this controller only has 1 value. When I changed "[s,s]" to "s;" it did the trick!
Thanks!


Return to posts index

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