ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Please assist me in updating this time remap marker expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Lauren Roundy
Please assist me in updating this time remap marker expression
on Sep 5, 2019 at 2:54:43 pm

Can anybody help me fix this so that I don't have to type a comment in the marker comment section?

I would love it if I could just replay the precomp animation every time there is a new marker (except for the first one)

// 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: Please assist me in updating this time remap marker expression
on Sep 5, 2019 at 5:04:38 pm

Nevermind. I finally found what I need!

// Keyframe your animation, starting on frame 0
// This property will animate at every marker on this layer

// If the property has no keyframes, the value at frame 0 is output
if (thisProperty.numKeys == 0) { t = 0; }

// Find the previous marker from current time
else {
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){ n--;}
}

// If there is no previous marker, the value at frame 0 is output
if (n == 0){ t = 0; }

// Calculate t from elapsed time since the last keyframe
else{
m = marker.key(n);
t = time - m.time;
}
}
valueAtTime(t)


Return to posts index

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