FORUMS: list search recent posts

"Triggering Animation with Markers" modification?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
James Ronan
"Triggering Animation with Markers" modification?
on Jan 5, 2017 at 6:31:54 pm

Hi all, I'm really hoping someone can help me!

I've been using Dan Ebberts marker sync script to time remap layers based on markers which is great...

l have 30+ pre comps all with the markers on them (same comment: IN OUT), and I want them to animate at the same times.

I'm wondering if it is possible to modify the time remap expression on each layer to look at another layer and it's markers instead?

See attached pic for an example:


Really really appreciate any help or information on how I could solve this problem.

Thanks so much!

James


Return to posts index

Dan Ebberts
Re: "Triggering Animation with Markers" modification?
on Jan 5, 2017 at 7:32:12 pm

Something like this maybe:


myMarker = thisComp.layer("Other Layer").marker;
n = 0;
if (myMarker.numKeys > 0){
n = myMarker.nearestKey(time).index;
if (myMarker.key(n).time > time){
n--;
}
}

if (n == 0){
0
}else{
m = myMarker.key(n);
myComment = m.comment;
t = time - m.time;
try{
actMarker = action.marker.key(myComment);
if (action.marker.numKeys > actMarker.index){
tMax = action.marker.key(actMarker.index + 1).time - actMarker.time;
}else{
tMax = action.outPoint - actMarker.time;
}
t = Math.min(t, tMax);
actMarker.time + t;
}catch (err){
0
}
}



Dan



Return to posts index

James Ronan
Re: "Triggering Animation with Markers" modification?
on Jan 5, 2017 at 11:05:55 pm

Hey Dan!

Yesssss!! This worked great! Thank you so much!

I had to add back in the original line where we declare the 'action' variable, but it works!

Working code:

myMarker = thisComp.layer("Other Layer").marker;
action = comp("Other Comp").layer("action");

n = 0;
if (myMarker.numKeys > 0){
n = myMarker.nearestKey(time).index;
if (myMarker.key(n).time > time){
n--;
}
}

if (n == 0){
0
}else{
m = myMarker.key(n);
myComment = m.comment;
t = time - m.time;
try{
actMarker = action.marker.key(myComment);
if (action.marker.numKeys > actMarker.index){
tMax = action.marker.key(actMarker.index + 1).time - actMarker.time;
}else{
tMax = action.outPoint - actMarker.time;
}
t = Math.min(t, tMax);
actMarker.time + t;
}catch (err){
0
}
}


Thanks again!

James


Return to posts index

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