5 Replies Latest reply on May 11, 2018 8:00 AM by Rick Gerard

    Control two (X-)position keyframes while keeping the (temporal) interpolation

    carlosg26489137 Level 1

      Hi, I'm a little bit new to expressions. After hours of googling trying and coding I gave up and try to get some help here.

       

       

      I just want to keep my simple animation with the temporal interpolation. I only want to change with two sliders two keyframes. Is that somehow possible?? I found much codes for scale, opacity, and also some for position but none of these work for me

       

       

      image_20180510150504_1.png

       

       

      Thank you very much!!! I'd very happy if anyone could also explain the expressions to me!

       

       

      Here are some of my tries:

       

      {

        slider = key(1);

      t2 = key(2);

      t3 = key(3);

      t4 = key(4);

       

       

       

       

        slider = comp("Comp 1").layer("txtlayer").effect("Keyframe Slider 1")("Slider");

      slider2 = comp("Comp 1").layer("txtlayer").effect("Keyframe Slider 2")("Slider");

        t1 = [slider];

      t2 = 960 = t3;

      t4 = [slieder2];

       

       

      }

       

       

       

       

      // other expression now

       

       

       

       

      if (numKeys > 1){

        t1 = key(1).time;

        t2 = key(2).time;

      t3 = key(3);

      t4 = key(4);

       

       

      slider = comp("Comp 1").layer("txtlayer").effect("Keyframe Slider 1")("Slider");

        linear(time,slider,t2,t3,t4);

      }else

       

       

      valueAtTime(t);

        • 1. Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
          carlosg26489137 Level 1

          strengthControl = effect("Slider Control")("Slider");

          strengthKey = 0

           

           

          n = 0;

          if (numKeys > 0) {

          n = nearestKey(time).index;

            if (key(n).time > time) n--;

          };

           

           

          if(n==strengthKey){

          value+strengthControl} else value;

           

           

           

           

          this code for example doesn't work well. Because I get animation jumps

          • 2. Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
            Rick Gerard Adobe Community Professional & MVP

            I may be tired but I cannot figure out what you are trying to do.

             

            What do you want to do with the first and last keyframes?

             

            Do you just want to change their values with a slider? If so, you'll need two sliders, maybe three to control x, y, and z or better yet use the Expression Point Control.

             

            Do you want to change the timing of only the first and last keyframe?

             

            You can identify keyframes by number in expressions, you can add named markers to the timeline and reference them. I don't understand what you are trying to do or what you are trying to adjust. Without a detailed explanation of what you are trying to accomplish I can't be of much help.

            1 person found this helpful
            • 3. Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
              carlosg26489137 Level 1

              I want to create a essential graphics template for PP, that's why I need a slider

               

              Yes I want to change the values of the first and last keyframe with a slider. The first and last keyframe have always the same value, that's why I only need only one slider.

               

              I also just need to change the X value, but it would be also nice to know how to do that also with the y und z value. But I have no camera so X & Y are enough for me because of flat design.

               

              I want to change the X value of the first and last keyframe, that's it

               

              Thank you very much my friend!

               

              the problem is i dont know how to achieve that, because some scripts that I tried only changes the X position in the exact frame where the keyframe is. so there's no consideration to the interpolation, that's what I call ''animation jumps'', it just looks really terrible. :/

              • 5. Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
                Rick Gerard Adobe Community Professional & MVP

                This uses a slider to control the X value of the first and fourth keyframe.

                x  = effect("Slider Control")("Slider");

                if (time <= key(1).time || time >= key(4).time)

                  sv = x;

                else sv = value[0];

                 

                [sv, value[1]]

                It's pretty basic if language. You could have figured it out by reading the expression guide in the AE help files. The X position is going to jump when you get to the first and fourth keyframe because there is no transition between the x value that comes from the slider to the x value in the first keyframe. I would have to open up AE and play with this idea for a few minutes to make that happen. I would probably add two markers to the layer to start the move and only have two the middle two middle keyframes remain.

                 

                Please describe the motion you are trying to create. I have a feeling that you are going about this in an inefficient way.

                1 person found this helpful