Activity › Forums › Adobe After Effects Expressions › “Triggering Animation with Markers” modification?
-
“Triggering Animation with Markers” modification?
Posted by James Ronan on January 5, 2017 at 6:31 pmHi 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
Dan Ebberts replied 7 years, 7 months ago 3 Members · 8 Replies -
8 Replies
-
Dan Ebberts
January 5, 2017 at 7:32 pmSomething 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
-
James Ronan
January 5, 2017 at 11:05 pmHey 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
-
Colin Woodcock
October 5, 2018 at 9:03 pmHow would I go about using the layer marker triggering system and referencing an animated colour control from a different comp? The sequence of colours don’t line up for me after using a direct pick whip. Here’s what I have – comp(“masterComp”).layer(“Light Controls”).effect(“Neon Colour 3”)(“Color”)
I’ve scoured the internet for a solution however my lack of expression knowledge is affecting my search terms!
In a nutshell, I have 3 different comps of neon lights as my base, and it’s these base comps that will have the expression applied. These comps (“Neon Tube_Ambient_Green” is one example) are using the layer marker system to switch between varying brightness using hold keyframes. After 3 precomps, all using the layer marker expression for varying reasons, I would then like to have a master comp with colour controls that include my selections at specific points in time, for this comp only.
Any help would be greatly appreciated.
-
Dan Ebberts
October 5, 2018 at 9:35 pmAssuming that your precomp layer doesn’t start at time 0 in the master comp, something like this should fix it:
C = comp(“masterComp”);
ctrl = C.layer(“Light Controls”).effect(“Neon Colour 3”)(“Color”);
L = C.layer(thisComp.name);
ctrl.valueAtTime(time + L.startTime)Dan
-
Colin Woodcock
October 5, 2018 at 11:01 pmThank you so much for getting back so quickly.
Unfortunately, After Effects is returning this error.
After Effects warning: Expression disabled. Error at line 3 in property ‘Color’ of layer 2 (‘RED’) in comp ‘Neon Tube_Ambient_Red’.
layer named ‘Neon Tube_Ambient_Red’ is missing or does not exist. It may have been renamed, moved, or deleted, or the name may have been mistyped.Should I have personalised anything within your expression?
Here’s a link to my stripped back source file – https://f1.creativecow.net/file.php?id=12767&folder=colour-control-with-layer-marker-syncAgain, thank you for your time.
-
Dan Ebberts
October 5, 2018 at 11:52 pmAh, it’s trickier because you have the expression nested 3 subcomps deep. I think you have to compensate for any precomp that doesn’t start at time zero in its parent comp. It appears that may only be happening in the main comp, so give this a try (it should at least get rid of the error message):
C = comp(“masterComp”);
ctrl = C.layer(“Light Controls”).effect(“Neon Colour 3”)(“Color”);
L = C.layer(“Neon Tube_Multi Coloured Pattern 1”);
ctrl.valueAtTime(time + L.startTime)Dan
-
Colin Woodcock
October 13, 2018 at 10:04 pmApologies for not responding sooner Dan. Unfortunately I couldn’t get his to work.
I had to set things up in a more long-winded way in the end.
Here’s a frame by frame example of what I’m seeing in the stripped back project – https://f1.creativecow.net/file/12799/12799_colourcontrolwhenusingmarkersync.mp4.zip
Reply to this Discussion! Login or Sign Up