ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Need to modify a marker-based expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Lauren Roundy
Need to modify a marker-based expression
on Sep 4, 2019 at 10:41:08 pm
Last Edited By Lauren Roundy on Sep 4, 2019 at 11:11:00 pm

I have a small animation happening in a precomp. Then, when that precomp is nested into the main comp, I have the following expression applied to Time Remap.

I would like to adjust the expression so that I don't have to type a comment in the marker comment section. In other words, I want it to do what it is currently doing with the markers but without having to type a comment for every marker.

I just want it to play the same animation every time I have a marker (except for the first marker).

Thanks!

// Marker Sync Expression
// Modified expression based on Dan Ebbert's Marker Sync Expression
// Original Version: http://www.motionscript.com/design-guide/marker-sync.html

src = comp("Death_icon").layer("Markers");
n = 0;
if (marker.numKeys > 0) {
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) {
n--;
}
}
if (n == 0) {
0
} else {
m = marker.key(n);
myComment = m.comment;
t = time - m.time;
try {
mark = src.marker.key(myComment);
if (src.marker.numKeys > mark.index) {
tMax = src.marker.key(mark.index + 1).time - mark.time;
} else {
tMax = src.outPoint - mark.time;
}
t = Math.min(t, tMax);
mark.time + t;
}catch (err) {
0
}
}


Return to posts index

Lauren Roundy
Re: Need to modify a marker-based expression
on Sep 5, 2019 at 2:37:00 pm

Any help with this?


Return to posts index

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