2 Replies Latest reply: Jul 22, 2013 4:29 AM by Pablo Apiolazza RSS

    Can I control the in and out point of a layer with a keyframe?

    Pablo Apiolazza

      Hi all, I'm working in a sort of template for a series of mograph videos. Some sort of motion typography work.

      The animation is always the same but the only thing that changes is the length of the video (for legibility purposes).

      I was wondering if I can control the in and out points of a layer with the keyframes from another layer.

       

      Lets say Layer's A keyframe from slider 1 position in time is the out point (plus/minus an offset would be also great) of layer B.

       

      I've been playing with expressions on a regular basis but I don't really know where and how to write an expression like that or if it's possible.

       

      Thanks in advance

        • 1. Re: Can I control the in and out point of a layer with a keyframe?
          maxweel Community Member

          This should probably be moved to the expression forum then.

           

          I'm not sure I understood the details of your project but here's a basis: you can do that with an expression in the layer's time remapping property. So if you want a layer to start playing at the second keyframe on another layer, you can try something like (writing in my browser, watch for mistakes):

           

          //   The "number" of the keyframe (first, second, third, etc)
          var index = 2;
          
          //   The layer with the keyframes
          var l = {pick-whip the layer with keyframes here};
          
          //   Just a safety, check the layer has at least enough keyframes
          if (l.numKeys >= index)
          {
               //   If yes, the new time is the difference between the keyframe's time and the current time
              max(0, l.key(index).time-time);
          }
          else
          {
               //   Doesn't matter, let's return 0
              0;
          }
          
          • 2. Re: Can I control the in and out point of a layer with a keyframe?
            Pablo Apiolazza Community Member

            Well that's pretty interesting but it's not exactly what I'm looking for, cause it would modify the speed of the animation.

             

            Here's an image trying to illustrate better what I wantKeyframe controlling in out.JPG