Tutorial 7 - Animation

This tutorial assumes that you have a basic understanding of "4D Blue" functions, especially that you know how to move, adjust and rename objects. In this tutorial we will start from an existing simple scene and add a simple bouncing ball animation. This tutorial also covers how to key frames, auto-key parameters, and then adjust existing animation curves.

Step 1 - Animating the ball position.

Picture

We will start this tutorial with an already existing scene. You can now download the ball scene: Download "Tutorial 7" Scene. The scene should look like the image on the left.

Picture

Select the "Sphere" object and press the "Key" button. You will notice that the colors of the controls have changed to dark orange. "4D Blue" uses three colors to signal animation states of controls. The light yellow means the control can be animated, but it currently has no animation key frames. The orange color means the control has animation key frames, but no key frame at the current time. Eventually the dark orange color means that the controls has animation key frames and there is an animation key at the current time.

Picture

You can change the time by using the "Animation Toolbar" at the bottom of the screen. You can left click on the slider to select a new time. As an option, you can select the new time in the edit box on the top right of the toolbar. If there is more than 100 frames of animation, you can move the slider using the right mouse button.

Picture

Select time frame 30 on the time slider. Change the sphere's "Translate Y" value to -0.1 and key the frame. Then set time frame 60 and set the "Translate Y" value back to 1.0 and key the frame.

Picture

Now when you press the "Play" button, the ball should move up and down. The animation stops playing when the current frame reaches the playback end frame, which is marked by the red arrow. If you wish, you can now change the "Playback End Frame" to 60. You can always stop the animation playback at any time by pressing the "Stop" button.

Picture

If you play the animation, you will notice the balls slow down before hitting the "floor". That is clearly not desirable and we need to change it. Now it is time to fine tune the ball motion. Open the "Animation Editor" using the button on the left or from the "Window" menu.

Picture

In the "Animation Editor" select the "Sphere" then the "XForm" and eventually double click on the "Translate Y". The Y translation animation curve will be selected and shown on the right window. More than one animation curve can be shown at one time - you can select the curves using the "Ctrl" and "Shift" keys.

Picture

In the "Animation Editor", you can also use the "Alt" + mouse buttons to adjust the view properties. Please try it now. Eventually to save time, you can auto-frame the currently selected curve or auto-frame all of selected curves by using the "f" key for single curve, or "a" key for all selected curves. Please try it now. Using the techniques I just mentioned, you should eventually see a curve which looks like the one on the left.

Picture

Select the little white square at the bottom of the curve using the left mouse button. The squares represent keys. Once you select the key, you will see two addition blue lines and tiny boxes at the end of them. These lines represent the curve tangents at the selected key. Select them by left clicking on the boxes and adjust them using the middle mouse button until the curve looks like the one on the left image. The values should be around 5.0. When finished, close the "Animation Editor" and playback the animation. The motion looks so much better now. In the next step we will learn how to make the ball stretch and squeeze as it moves in the air and hits the ground.

Step 2 - Modifying the ball as it moves in the air.

Picture

In this step we will use the "Stretch" transformation to stretch the ball as it falls down and then squeeze it as it hits the ground and bounces back. Select the "Sphere" and add an "XForm" transformation and set its "Translate Y" value to 0.4. In a few moment, it will become obvious why we need to do it. The value of 0.4 is exactly the same as the sphere radius. No need to key this transformation as we will not animate it.

Picture

Now add the "Stretch" transformation. This time we will use a different animation technique called "auto-keying" to key only the parameters that we change. You probably have noticed that when animating the ball we would key the whole XForm including the parameters that don’t change at all. With "auto-keying" we also don't have to press the "key" button every time we make changes which often can save us a lot of time when creating complex animations. With some experience you will really like "auto-keying".

Picture

Press the small "key" button to enable and disable "auto-keying". Red color means the "auto-keying" is enabled.

Picture

Using auto-keying we will now animate the "Stretch" transformation. Make sure the current time is 0 and then select "Stretch Ratio" and enter 0.0. The color of the control should change to dark orange. Now change the time to 25 and enter a value of 0.4, then at time 30 a value of -0.3, at time 35 a value of 0.4 and eventually at time 60 a value of 0.0. You probably have noticed that the ball "stretches" from the bottom rather than the center. That is because we moved its center up by 0.4 using the XForm transformation right before this transformation. Play the animation. You will notice the ball does in fact stretch and squeeze, but it is too high and it bounces back too fast. We need to fine tune the ball movement again.

Picture

Open the "Animation Editor" and select the two curves as shown on the left image using the "Ctrl" key plus left mouse button.

Picture

You should see two curves as shown on the left image. Select the green curve by left clicking on it.

Picture

Around frame 25 using right mouse button, add a new key on the animation curve. Then using the middle mouse button, adjust its position to time 25 and value of -0.5. If needed temporally, move the "Stretch Ratio" curve to access the "hidden" key.

Picture

Using the methods that we have just learned, adjust the other point on the "Translation Y" curve to time of 32 and value of -0.5. The final curves should look like the one on the left. If you preview the animation now the motion seems so much better and the ball seems to bounce back right on time.

Picture

The only thing left is to render the complete animation. Open "Render Setup" and adjust the output parameters as shown on the left image..

Picture

Since we are going to render an animation, it might make sense to render it into a "movie" file format - AVI. Usually during production, I would render each frame into file, but it is often easier just to produce a "ready" movie file for quick previews.

Picture

On the left, the image is frame 30 from the animation. You have completed your first animation. But that was a simple bouncing ball. In 4D Blue almost every parameter can be animated, allowing you to move and change objects, curves, textures, materials, and so much more. For example, you can create ripples on the water by animating "waves" texture or sunset by animating "ramp" texture. You can even animate curves or objects by using "morphing" transformations. If you don’t wait for the whole animation to be rendered you can now download the final ball animation: Download "Ball" Animation