4 Replies Latest reply on Jun 3, 2015 9:06 AM by SpectralKH

    Moving multiple objects equally at different times (with key frames using null object?)?

    SpectralKH

      Let's say I want to move a text object from 500,500 to 500,100. Then, moving it from 500,100 to 100,100. I want to be able to easily choose when these objects hit their destination (not when they start moving). I would like to be able to choose this with keyframes (so if it specified that the first keyframe does the first action, then the second keyframe does the second).

       

       

      I'm using this for sliding between different track names in podcast videos, and it would really make my life so much better.

       

       

      Side-question: Is there any way to move an object without the y tool so an object won't move masks with it?

        • 1. Re: Moving multiple objects equally at different times (with key frames using null object?)?
          Dave LaRonde Level 6

          Sure: just get to know another kind of keyframe, the HOLD keyframe.  Use it at the end of that first move.  The layer will remain rock-steady until it encounters another keyframe.  If this new keyframe happens to have the same position values as the hold keyframe, it will now begin the second move to the second position.

           

          Just make sure those position values are precise, or you'll see a jump when the starting keyframe for the second move is encountered.

          • 2. Re: Moving multiple objects equally at different times (with key frames using null object?)?
            Mathias Moehl Adobe Community Professional

            And if you really want to have just one keyframe per position (instead of two - one where it should arrive at this position and a second one where it should start traveling to the next one), you can refine Dave's idea by applying the following expression to the position property with the HOLD keyframes

             

            var duration = 0.5;  // transition duration in seconds
            smooth(duration,100);
            

             

            Now you just need one (hold) keyframe for each position and the 0.5 in the expression tells that it should take 0.5 seconds to travel from one hold keyframe to the next one.

             

            If you don't want to write your own expressions code, you can also use the Basic Smoother iExpression

            basic_smoother.png

            As with the other expression, just set the Samples to 100 and the Width to the number of seconds that it should take to travel from one hold keyframe to the next one.

            • 3. Re: Moving multiple objects equally at different times (with key frames using null object?)?
              Rick Gerard Adobe Community Professional & MVP

              I guess I'm not really understanding what you are trying to do. Moving keyframes around the timeline is as easy as selecting them and dragging them. You can position the CTI on the exact frame you want to move a keyframe to and then hold down the shift key to get the keyframe you are dragging to snap to the CTI or you can snap to markers.

               

              If you enable the stop watch you start generating keyframes as you move layers around. If you want to smooth things out then there's automatic easing built in by simply selecting a keyframe and pressing F9.

               

              If you want to automate specific animations then you can write expressions based on in and out points of layers or layer markers. For example this Animation preset causes a 2D layer to start just off screen no matter what the position or scale, fly in and bounce to a stop, then fall off the bottom of the screen just before you reach the out point of a layer. Slider controls are added to the layer to control the speed, bounce and other things. All you do is apply the Animation Preset, set an in and out point, set the CTI in the middle of the layer and drag it into it's resting position and you're done. The layer flies in from the left, bounces to a stop, then falls off the comp just before the out point. I have hundreds of these that I have written to speed up my work. I hardly ever set keyframes for this kind of animation anymore.

               

              Here's the expression so you can see what's going on but you'll have to add the sliders and checkboxes yourself if you want this expression to work:

              sif = effect("slideIn Frames")("Slider");

              sof= effect("slideOut Frames")("Slider");

              // find in and out point

              inTime = sif * thisComp.frameDuration;

                if (effect("Match SI SO")("Checkbox") == 0) {

                outTime = sof * thisComp.frameDuration;

                }

                else if (effect("Match SI SO")("Checkbox") == 1) {

                outTime = inTime;

                }

              // Fix  layer size when scaled

              sf = scale - [100, 100];

              xSize = width + (width * sf[0]/100);

              ySize = height + (height * sf[1]/100);

              realSize = [xSize, ySize];

              // Set Positions

              spx = 0 - realSize[0] + realSize[0]/2 ;

              rstx = value [0];

              rsty = value[1];

              epy = thisComp.height + realSize[1] - realSize[1]/2;

              // create movement

              freq = effect("bounce Frequency")("Slider");

                      amplitude = effect("bounce Amplitude")("Slider");

                      decay = effect("bounce Decay")("Slider");

                  posCos = Math.abs(Math.cos(freq*time*2*Math.PI));

                  y = amplitude*posCos/Math.exp(decay*time);

              moveIn = Math.min(linear(time,inPoint,inPoint + inTime,spx  ,rstx-y));

              moveOut = Math.min(linear(time,outPoint - outTime,outPoint - thisComp.frameDuration,rsty ,epy));

              [moveIn, moveOut]

              • 4. Re: Moving multiple objects equally at different times (with key frames using null object?)?
                SpectralKH Level 1

                This helps me, yet I am entirely new to this area of After Effects, and I'm unsure of how I would do this. I imagine an alternative way for this to work as well; Having an expression to perform the move (start property, time, end property) and then a keyframe would tell when this action is ended or started. Is there a way to do this, and if there is, will you elaborate a bit further? Maybe you can also have a null object with expressions to do this also?