ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

"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


colin woodcock
Re: "Triggering Animation with Markers" modification?
on Oct 5, 2018 at 9:03:20 pm

How 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.


Return to posts index

Dan Ebberts
Re: "Triggering Animation with Markers" modification?
on Oct 5, 2018 at 9:35:38 pm

Assuming 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



Return to posts index

colin woodcock
Re: "Triggering Animation with Markers" modification?
on Oct 5, 2018 at 11:01:27 pm

Thank 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-lay...

Again, thank you for your time.


Return to posts index


Dan Ebberts
Re: "Triggering Animation with Markers" modification?
on Oct 5, 2018 at 11:52:08 pm

Ah, 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



Return to posts index

colin woodcock
Re: "Triggering Animation with Markers" modification?
on Oct 13, 2018 at 10:04:56 pm

Apologies 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_colourcontrolwhenusingmarkersyn...


Return to posts index

Dan Ebberts
Re: "Triggering Animation with Markers" modification?
on Oct 13, 2018 at 10:40:57 pm

No time remapping turned on anywhere?

Dan



Return to posts index

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