2 Replies Latest reply on Nov 1, 2016 2:11 AM by Søren Nowakowski

    Controlling timing of keyframes pasted from mask path.

    Søren Nowakowski Level 1

      Hi y'all.


      I have made a Mario Kart style map in after effects, with three player icons following the map from start to finish.


      The map is made out of a handdrawn mask on a solid, with the "stroke" option added to give me a nice filled white line.

      The mask path is then copied over to each of the player icons position. That gives me roughly 10 keyframes to play with. And when I play it back they follow nicely.


      However, I need to make some timing adjustments on these player icons, according to some footage that was shot. I need the position of the players on the map to be somewhat close what is happening in the actual footage. I know I can re-size the spacing between all the keyframes with an Alt drag, and easily have the keyframes lined up so they match the start and end of the race. But I need more control than that.


      Now, if I add keyframes to the existing 10, everything gets messed up. The icons wont follow the path no more. The beziers goes derp derp. And with the limited amount of keyframes to play with, it gets quite annoying trying to time the race right. It's like colorgrading and setting whitebalance with scopes; you move one, the other two moves accordingly. It's a constant back n forth trying to match all the important moments in the race with the keyframes.


      I tried precomposing to see if a time remap would help me, but once again: when I get one place in time just right, all other values keep wandering around.


      What I really need, is some magical workaround, where I can tie the existing keyframes to a slider somehow. The idea being a "completion" slider, from 0 to 100, that would give me pinpoint control over the timing of every icon on the map throughout the race, without having to worry about the icons position on the mask path.


      Does that make any sense? Is it doable?

        • 1. Re: Controlling timing of keyframes pasted from mask path.
          Mylenium Most Valuable Participant

          There's nothing magical about it. It's just valueAtTime() stuff. However, the added difficulty is that you need a lot of extra code to determine the current span you are in between two keyframes, since the nearestKeyframe() method really only determines that time and you need to figure out which is the preceding key and which the next depending on which side of the midpoint of the span you are. I'm sure I have some example somewhere in my archivce, but i haven't got it handy and I'm too lazy to cobble it together from memory... If all else fails, you can of course create a separate slider for each segment and use a simple linear() interpolator driven by the slider value. Reading your post I also get the impression that you should try roving keyframes and then in fact simple time-remapping might work beautifully, too.