ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Marker keyframe in precomp to slider expression control

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nathaniel Akin
Marker keyframe in precomp to slider expression control
on Sep 5, 2017 at 3:49:51 pm
Last Edited By Nathaniel Akin on Sep 5, 2017 at 4:04:36 pm

UPDATE: a little more searching and I find Dan already answered this question! For anyone else looking to do this the answer is here:

https://forums.creativecow.net/readpost/227/19361

Original post:
I'm using Dan Ebberts code for driving animation using markers and it's working great for me. What I'd like to do though is adapt it to use keyframe values from a slider control to select which marker in the pre comp is played. I've been hacking around at the script but can't get it to work. Any idea on how to fix this?

My ideal setup would be to have pre comp (ANI) with all animation in it and markers for each chunk of animation (i.e. 1, 2, 3, etc). In the main comp would be a null layer with a slider control that would select which portion of the pre comp is playing back (1,2,3 etc).

action = comp("ANI").layer ("action");

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{ 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 } }


-N
___________________
Nathaniel Akin
http://oxen.tv


Return to posts index

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