Activity › Forums › Adobe After Effects Expressions › Animating the Beam Effect with Layer Marker
-
Animating the Beam Effect with Layer Marker
Posted by Aharon Rabinowitz on October 30, 2008 at 8:22 pmHi folks-
How might I animate the Time property of the Beam effect to go from 0% to 100% over X amount of time, every time it saw a layer marker on a null object?
Precomping as a video and Time remapping won’t work because the effects End Point needs to change many times over the course of the animation.
Thanks.
Aharon
Aharon Rabinowitz
Email: arabinowitz (AT) yahoo (DOT) com
All Bets Are Off Productions, Inc.
Creative Cow After Effect Podcast
Internet Killed the Video Star: A Guide to Creating Video for the WebAharon Rabinowitz replied 17 years, 9 months ago 2 Members · 10 Replies -
10 Replies
-
Dan Ebberts
October 30, 2008 at 8:35 pmLike this:
x = 1; // transition time (seconds)
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){
n–;
}
}if (n > 0){
t = time – marker.key(n).time;
linear(t,0,x,0,100)
}else{
0
}Dan
-
Aharon Rabinowitz
October 30, 2008 at 8:45 pmThanks Dan! Is there a way I can have it delay in time. I want 4 beams to fire in succession. So beam one starts and then the next one starts and then the next one.
Is there a parameter I could add into this that would say delay playing the animation by X amount of time?
Best,
Aharon
Aharon Rabinowitz
Email: arabinowitz (AT) yahoo (DOT) com
All Bets Are Off Productions, Inc.
Creative Cow After Effect Podcast
Internet Killed the Video Star: A Guide to Creating Video for the Web -
Dan Ebberts
October 30, 2008 at 8:55 pmYou could have a delay based on the layer index, like this:
x = 1; // transition time (seconds)
delay = .1;n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){
n–;
}
}if (n > 0){
t = time – marker.key(n).time – delay*(index-1);
linear(t,0,x,0,100)
}else{
0
}Dan
-
Aharon Rabinowitz
October 30, 2008 at 9:03 pmThanks. Trying this out, I see it’s looking for the marker on this layer. Can I put the marker on a null?
Aharon Rabinowitz
Email: arabinowitz (AT) yahoo (DOT) com
All Bets Are Off Productions, Inc.
Creative Cow After Effect Podcast
Internet Killed the Video Star: A Guide to Creating Video for the Web -
Dan Ebberts
October 30, 2008 at 9:11 pmx = 1; // transition time (seconds)
delay = .1;
N = thisComp.layer(“Null 1”);n = 0;
if (N.marker.numKeys > 0){
n = N.marker.nearestKey(time).index;
if (N.marker.key(n).time > time){
n–;
}
}if (n > 0){
t = time – N.marker.key(n).time – delay*(index-1);
linear(t,0,x,0,100)
}else{
0
}Dan
-
Aharon Rabinowitz
October 30, 2008 at 9:15 pmThanks!
Ah… OK. I see. My keyframes are not actually doing anything. The expression animates the value entirely.
Problem. At 100% some of the beam is still visible. My keyframes set it back to 0%. But now that doesn’t happen. Is there a way to make it “rewind” or rather to jump back to 0% right after it gets to 100%?
Aharon Rabinowitz
Email: arabinowitz (AT) yahoo (DOT) com
All Bets Are Off Productions, Inc.
Creative Cow After Effect Podcast
Internet Killed the Video Star: A Guide to Creating Video for the Web -
Dan Ebberts
October 30, 2008 at 9:25 pmx = 1; // transition time (seconds)
delay = .1;
N = thisComp.layer(“Null 1”);n = 0;
if (N.marker.numKeys > 0){
n = N.marker.nearestKey(time).index;
if (N.marker.key(n).time > time){
n–;
}
}if (n > 0){
t = time – N.marker.key(n).time – delay*(index-1);
if (t <= x) linear(t,0,x,0,100) else 0 }else{ 0 } 🙂 -
Aharon Rabinowitz
October 30, 2008 at 9:28 pmGetting there – thank you. Very much appreciated.
However, now that I have 4 beams firing, if the marker comes before they have all finished firing, they all jump back to 0%. So even though it delays playing, it’s holding them at 0 until their time to fire comes. Is there a way around this?
Aharon Rabinowitz
Email: arabinowitz (AT) yahoo (DOT) com
All Bets Are Off Productions, Inc.
Creative Cow After Effect Podcast
Internet Killed the Video Star: A Guide to Creating Video for the Web -
Dan Ebberts
October 30, 2008 at 10:05 pmtry this one:
x = 1; // transition time (seconds)
delay = .1;
N = thisComp.layer(“Null 1”);myDelay = delay*(index-1);
n = 0;
if (N.marker.numKeys > 0){
n = N.marker.nearestKey(time – myDelay).index;
if (N.marker.key(n).time > time – myDelay){
n–;
}
}if (n > 0){
t = time – N.marker.key(n).time – myDelay;
if (t <= x) linear(t,0,x,0,100) else 0 }else{ 0 } Dan -
Aharon Rabinowitz
October 30, 2008 at 10:26 pmPhenomenal. Thank you!
Aharon Rabinowitz
Email: arabinowitz (AT) yahoo (DOT) com
All Bets Are Off Productions, Inc.
Creative Cow After Effect Podcast
Internet Killed the Video Star: A Guide to Creating Video for the Web
Reply to this Discussion! Login or Sign Up