Advertisement
balyberdin

Animation Triggered By Markers

Sep 26th, 2021
2,717
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. src = comp(name).layer("Control");
  2. n = 0;
  3. if (marker.numKeys > 0) {
  4.     n = marker.nearestKey(time).index;
  5.     if (marker.key(n).time > time) {
  6.         n--;
  7.     }
  8. }
  9. if (n == 0) {
  10.     0
  11. } else {
  12.     m = marker.key(n);
  13.     myComment = m.comment;
  14.     t = time - m.time;
  15.     try {
  16.         mark = src.marker.key(myComment);
  17.         if (src.marker.numKeys > mark.index) {
  18.             tMax = src.marker.key(mark.index + 1).time - mark.time;
  19.         } else {
  20.             tMax = src.outPoint - mark.time;
  21.         }
  22.         t = Math.min(t, tMax);
  23.         mark.time + t;
  24.     }catch (err) {
  25.         0
  26.     }
  27. }
  28.  
  29. // Dan Ebbert's Expression
  30. // https://www.motionscript.com/design-guide/marker-sync.html
Advertisement
Comments
  • rawde
    2 years
    # text 0.19 KB | 0 0
    1. Hi, is there a way to loop out the animation between the markers?
    2. I know I can do that by repeating the marker but is there a way to loop out one marker's animation till we add another one?
Add Comment
Please, Sign In to add comment
Advertisement