Attic:Books/Essential Blender (text)/Chapter 3

提供: wiki
移動先: 案内検索

Object Animation Basics

By Roland Hess

Animation is a change over time in some aspect of your Scene. That change can be something simple, like a change in the color or intensity of a light, or it could be something complicated, like the changes in position and shape of an entire group of characters dancing in time to music, while the camera whirls around the dance floor. Regardless of what happens in your Scene, there must be a way to track and record those changes.

In Blender, as in most animation software, these changes are recorded as "keyframes" or "keys" for short. A key is just a marker in time of some state, value or setting.

Callout: Animation information is stored in "keys".

Time

Before we review the keying tools, you should learn how to navigate in time.

The most visual method for doing this is to use the Timeline Window, found in the center of the default Animation Screen, but easily accessible in any window from the Window Type pop-up menu. (Remember: to access the default Animation Screen, use the Screens menu from the header at the very top of the Blender window.)

Figure OAD.1: The View menu on the Timeline window header.

The timeline can be viewed in either seconds or in frames. Blender's default is to break each second into 25 frames, the PAL video standard. (Most film/movie work uses 24 frames per second, while the North American video standard, called NTSC, uses roughly 30 frames per second). To change the display method of the timeline, you go through the Timeline Window header's View menu, or simply press the T-key with the mouse over the timeline. Frames per second can be set either with the "Set Frames/sec" entry in the Playback menu, or on the "Frs/sec" spinner in the Render buttons (F10).

The vertical green marker in the Timeline indicates the current frame. Using LMB in the timeline sets the marker and the current frame. The current frame is also displayed in the lower left hand corner of the 3D view, and in the header of the buttons window.

Figure OAD.1.1: The current frame number can be found in many places on the default animation screen.

Callout: The current frame can be set by LMB clicking within the timeline.

In addition to using the timeline to navigate through time, you can also use (surprise!) keyboard shortcuts.

Figure OAD.2: The arrow keys can be used to change the current frame.

The Right and Left arrow keys step forward and backward one frame. Up and down arrows step forward and backward by ten frames. Shift-Left arrow moves to the Start frame, while Shift-Right arrow moves to the End frame.

Callout: Right and Left arrow keys change the frame by one. Up and Down arrow keys change the frame number by ten.

The Start and End frames, which can be set in either the timeline's header or in the Render buttons, indicate the range of frames that will be shown when you give a "play back" command. You can tell Blender to play the animation between the Start and End frames in a couple of ways: the "play" button on the timeline header or with Alt-A in a 3D Window.

Callout: Alt-A with the mouse over a 3D view plays the animation in that view.

Creating Animation Keys

Keys can be set throughout Blender with the I-key. Pressing the I-key will almost always pop up an "Insert Key" menu, with entries appropriate to the mouse's location.

If the mouse is over the 3D window when the I-key is pressed, a key will be set for the active object.

Figure OAD.3: The Insert Key menu for the active object.

Blender's basic animation workflow is simple:

1. Use the time tools to find the frame where you would like to record a setting for animation; 2. Adjust your object how you want it to be at this point in time (location, colors, shapes, etc.); 3. Use the I-key to bring up the "Insert Key" menu, then select the appropriate key.

All objects can have Rotation, Location or Scale keys. The Insert Key menu shows several different combinations of those choices. In the menu, Loc stands for Location and Rot for Rotation. Thus, the LocRot entry in the menu creates a key for both Location and Rotation. LocRotScale creates keys for Location, Rotation and Scale. If you are only changing the location of an object in your animation, just use the Loc type key. Likewise, if you are only rotating an object, you would choose LocRot.

The Layer entry on the I-key menu sets an animation key for the layer settings of an object. You can make objects appear and disappear from a scene by keying them to move to a hidden layer at a certain frame.

Explanations for the rest of the entries in the object I-key menu wouldn't make much sense to you at this point, so we'll leave them for a more advanced text.

Callout: I-key brings up the "Insert Key" menu that lets you save states and settings for animation.

Once you have inserted a key for an object, you continue throughout the timeline to create your animation: pick a frame, adjust your object, set a key. Pick, adjust, set.

Many settings in Blender are keyable beyond simple object transformations. You can consult the documentation to find a comprehensive list of which settings and values can be keyed, but a better way to find out is to hover the mouse over the window of the item you would like to key and press the I-key.

Figure OAD.4: The I-key brings up a keying menu appropriate to the window you are working in.

Ipos and Ipo Curves

The upper right portion of the default Animation screen is used as an Ipo Window. Many new and migrating users are confused by the term Ipo, but it's simple, really. In order to create the animation between different keys, Blender (like any other 3D program) must "interpolate" between the keys. "Ipo" is just an abbreviation of InterPOlation. So the Ipo Window is just a window in which you can view the actual interpolation between animation keys.

Figure OAD.5: The Ipo window.

Once you have created keys for an object, they will show up, along with some curves, in the Ipo window. Each different setting gets its own curve, and in the illustration you can see that there are curves for LocX, LocY and LocZ - the x, y and z locations of the object. The Ipo window will show the curves for the active object in the 3D window, so if you want to see the Ipo curves of a different object, select that object in the 3D view.

You can drag with the LMB in the Ipo window to scrub through the animation, just like you could in the Timeline window. In fact, the horizontal axis in the Ipo window is the timeline, in frames, with current time marked by the vertical green line. The vertical axis shows the actual values of the keys.

Sidebar: Rotation Key Values

The exception to the rule about the vertical axis in the Ipo window is rotation keys. Rotation keys are represented in the Ipo window as one tenth of their actual value. In other words, a cube with a Y rotation of 125.25 degrees will show in the Ipo window as 12.52. This is done simply to keep the scales of the different curves in the Ipo window relatively similar. Although confusing at first, you'll soon not think twice about it.

End Sidebar

Working with Ipo Curves

The Ipo window shares controls with other areas of Blender. The scroll wheel and MMB function as zoom and view changing controls like they do in the 3D view (MMB only pans the view here). Also, the Home key automatically zooms and translates to show all the available objects, which in this case are keys. Curves can be selected with the RMB, and the G-key and S-key will move and scale the entire curve. With a curve selected, the Tab key can be used to enter Edit mode, allowing you direct access to the key points which you may move as you choose.

Callout: The Ipo window shares hotkeys and functions with the 3D window. RMB, and G-key and S-key for selecting and transforming curves. Tab key for Edit mode on curves.

Like the 3D window, the N-key brings up a Transform Properties panel that shows the exact values of selected curves and key points, and lets you edit them directly by typing in new values.

Figure OAD.5.1: The Transform Properties panel for the Ipo window.

Although you can use these tools to change the actual key values (like changing an x location key from x=5 to x=10), you will most often use the Ipo window to change curve interpolation styles, to set the extend mode and to adjust key timing, as you'll see next.

Callout: N-key brings up Transform Properties panel for curves and keys.

Interpolation Styles

Blender allows three different ways for values to change from key to key.

The default, which you've seen in the illustrations so far, is called "Bezier" mode, and refers to the style of curve in the preceding section. This mode leads to smooth transitions between key values, slower at the beginning and end of the change, and faster in the middle. Using the example of a ball moving between two locations, Bezier interpolation would have the ball start out slowly, reaching its maximum velocity halfway between the keyed locations, then slowing down before coming to a stop on the last key.

Linear mode moves between keys at a constant velocity. This interpolation type is useful when animating mechanical or non-natural motion.

Constant mode is of limited use. It causes values to stay the same (constant!) until the next key is reached, at which point they immediately change to the new value. It would be used, for example, to cause an object to seem to "teleport" from one location to another.

Figure OAD.6: The different interpolation types.

Interpolation styles can be set by selecting the curves whose style you wish to change, then selecting the appropriate style from the Interpolation Mode entry in the Curves menu of the Ipo Window header. Alternately, you can use the T-key shortcut (think "inTerpolation") to pop up a menu directly within the Ipo window.

Figure OAD.6.1: Choosing interpolation types from the Curve menu on the Ipo window header.

Callout: T-key brings up the Interpolation mode menu, letting you choose from Bezier, Linear and Constant.

Extend Modes

Sometimes, you will want to create a bit of animation that continues forever. A quick way to do this is to create one piece of the animation, and then use Ipo Extend Modes.

Very simply, if the Ipo curves in this illustration represent the motion of an object moving around in a circle:

Figure OAD.7: [no text]

Then this illustration represents that same motion repeating over and over.

Figure OAD.8: The same Ipo curves in Cyclic mode.

You access Extend Modes by selecting the Ipo curves you wish to extend, then choosing the extend style you would like from the Extend Mode entry in the Curve menu on the header.

Figure OAD.8.1: Choosing an Extend mode from the Curve menu on the Ipo window header.

Constant: this is the default Extend Mode that all Ipo curves have. This is what you would consider "normal" Ipo curve behavior, and the only one you have seen so far.

Extrapolation: this mode takes the slope of the curve at the first and last keys and simply extends them, forward and backward in time, forever.

Cyclic: cyclic extend causes the animation between the first and last keys to repeat over and over, resetting each time.

Cyclic Extrapolation: this mode repeats the animation like cyclic mode, but instead of resetting, it uses the last repetition's endpoint as its starting point.

Figure OAD.9: The Extend modes.

Callout: Extend modes can be set through the Curves menu on the Ipo window header.

Key Timing

When you are setting keys for your animations, you probably will be guessing as to how long certain actions should take. How quickly should the ball fall toward the floor? How long does it take for a character to turn his head in surprise? The odds are that you won't know the answer until you play back your animations to see what looks right. Although the proper location and rotation keys may be in place for such things, their correct timing is just as crucial.

Adjusting key timing in the Ipo window is quick and easy.

Within the Ipo window, press the K-key to enter Key mode. Every frame that has a key now shows a vertical line that is selectable with the RMB. Using the G-Key to move that vertical line will move all keys that fall along it to the left or right (backward or forward) along the timeline.

This illustration shows the circular motion animation curves in Key mode. The keys on Frame 16 have been RMB selected.

Figure OAD.10: The Ipo window in Key mode.

Using the G-key, you can move the entire set of keys from Frame 16 to the left or the right to adjust their timing. As you do this, the curves update in real time.

Figure OAD.11: The curves adjust to follow the movement of keys.

Callout: The K-key toggles Key mode in the Ipo window, which lets you quickly adjust the timing of your keys.

While this chapter has shown you the mechanics of moving and animating objects in Blender, it hasn't even touched on the artistic aspects of animation. Indeed, entire books have been written on the subject. Once you are comfortable with the mechanics of animation in Blender, you're encouraged to start practicing and improving your art.

Object Manipulation Basics

Note: For almost every hotkey function in this chapter, there is a corresponding entry in the Select and Object menus in the 3D View header. Although Blender's hotkey system was originally designed for maximum efficiency (and still retains much of that quality), it can be a bit daunting to new users. If you find yourself at a loss for the hotkey for a particular function, check out the menus. In fact, periodically browsing the menus is a great way to discover new functionality. This book is really just a primer - there is a lot more depth to be found, and the menus are a nice way to start experimenting once you've mastered the basics.

Coordinates

Understanding the coordinate system is the absolute baseline of 3D manipulation. If you have any experience with this at all, you can skip to the next section without fear.

Figure OMD.1: [no text]

In the illustration, you'll see a line labeled "X", with value markings along it, and a circle whose center is a dot. The circle's center dot rests on the marker labeled "3". In graphics terminology, you would say that the location of the circle is, simply, 3.

Figure OMD.2: [no text]

Now, we've added another dimension to the illustration. This time, the center of the circle can be traced down to the "3" on the "X" line and to the "2" on the "Y" line. Each of these lines is called an "axis". When you talk about the location of the circle, you say that its x and y coordinates are 3 and 2. This is commonly written as "(3,2)".

Figure OMD.3: [no text]

We're in 3D now (3 Dimensions: x, y and z). The center of the circle is still at (3,2) along the x and y axes, but we've added a third axis, z. The circle's center point is four units up on the z axis, so it's final coordinate is (3,2,4).

As you can see on the axes in the illustrations, the coordinate systems go off into both positive and negative directions, so (x,y,z) values will not always be positive.

The 3D Cursor

Figure OMD.5: The 3D cursor.

The 3D Cursor is a focus for activity in Blender's workspace. You set its location by using LMB in a 3D view. When new objects are created and added to a Scene, they are born at the location of the 3D Cursor. When objects are rotated or resized, the 3D Cursor can be used as the center of the transformation. Some beginners find it useful to think of the 3D Cursor like the standard cursor in a word processor: you set its location with the LMB, and when you type, it's where the letters appear.

The 3D Cursor is also useful as a quick reference point when you are animating. For example, if you are animating a character and want to make sure that its elbow remains still, despite the rest of the body moving around, you could set the 3D Cursor to match the starting location of the elbow, giving you a quick visual reference for adjusting the elbow's location later.

Callout: LMB click sets the location of the 3D Cursor.

Types of Objects that Can Be in a Scene

Scenes are made up of geometry objects, control objects that can affect geometry objects' motion and shape, lamp objects that provide light, and camera objects that provide a viewpoint from which to render. Of the available types of objects, the most commonly used are:

Mesh: Most of your 3D models will be Mesh objects. There are many starting points for Mesh objects, all accessible from the toolbox Add menu, including a cube, cylinder, plane, circle, cone and two kinds of spheres.

Figure OMD.7: A selection of mesh primitives.

Empty: An Empty object functions as a sort of placeholder in 3D space. They have many uses that you will find throughout the rest of this book.

Figure OMD.8: Several different visualizations of Empty objects. The default method is shown in white.

Lamp: Lamp objects are used to define from where light is cast within a scene. The type of lamp object determines what style of light is produced.

Figure OMD.9: An assortment of lamp objects.

Armature: Armature objects are best thought of as skeletons. They do not show up in images you create, but are used as control objects to change the shape of (usually) Mesh objects, in much the same way that your own skeleton defines and controls the overall shape of your body.

Figure OMD.10: There are several drawing methods for armatures.

Camera: Scenes can be viewed and rendered from the perspective of Camera objects. You can have several cameras in the same scene.

Figure OMD.10.1: The camera object from different angles.

Creating and Adding Objects

Figure OMD.6.1: The Add menu in the toolbox.

Objects are created and added to a Blender scene by using the Toolbox, which is brought up by pressing Spacebar in the 3D view. From the toolbox, the Add menu contains all of the kinds of objects Blender has available.

When you use the toolbox's Add menu to create an object, it is added to the scene at the current location of the 3D Cursor. You will also find that objects are added to a scene with their orientation facing directly toward the current 3D view. This means that if you create an object while in some odd viewing angle you've achieved through MMB view rotation, the object will face directly toward your view, and will begin its life with corresponding rotation values.

Callout: Objects are created and added to a Scene through the toolbox, which is accessed by pressing the Spacebar.

Mesh objects, and other editable object types, are created in Edit mode. Edit mode allows you to change the structure of the object (adding several faces to a cube, shrinking the center rings of a sphere, etc.). However, when you want to move objects around, for animation purposes or just to organize your Scene, you need to be in Object mode. Notice in the illustration below how the structure of the object is highlighted in Edit mode, making it easier to modify. To put the object into Object mode, press the Tab key.

Figure OMD.11: The object on the left is in Object mode; the one on the right, Edit mode.

There are too many combinations of display, selection and mesh modes to give you a hard and fast rule for determining whether objects are in Edit or Object mode. The surest way to tell is to look at the Mode menu in the 3D view header.

Figure OMD.12: You can always tell the mode of the Active object by looking at the 3D header.

Callout: The Tab key toggles between Edit mode and Object mode.

Making Selections

Selection in Blender is accomplished with the RMB. RMB clicking on consecutive objects will make each one the only selected object. A selected object has a pink outline when in solid view mode, and pink edges when displayed as a wireframe. If you want to select multiple objects, hold down Shift while using RMB.

When you first select an object, whether through a plain RMB click or through Shift-RMB, it is called the Active Object. Regardless of how many objects are selected, there can only be one Active Object. It is outlined with a brighter pink than the rest of the selected objects. Many operations, such as copying object attributes, creating parent-child relationships and adding constraints, will use the Active Object as their target.

Using Shift-RMB to click on the Active Object will completely deselect it. If you have been holding down the Shift key and using RMB to select several objects in a row, only the last object selected will be designated as the Active Object. In order to deselect one of the other, non-Active, objects, you must Shift-RMB click on it once to make it the Active Object, then Shift-RMB click on it again to deselect.

Callout: RMB selects an object, and makes it the Active Object. Shift-RMB builds selection. Shift-RMB on the Active Object deselects.

There are other methods of selection useful when selecting objects that are all within a certain area of the view. Pressing the B-key in the 3D View puts the cursor into Border Select mode. Dragging with the LMB draws a box on the screen, and any object that has a portion of itself within that box will be selected when you release the mouse button. You can also use Border Select to deselect as well - after pressing the B-key, dragging with the MMB will deselect anything that falls within the dragged box.

Callout: B-key with LMB border selects. B-key with MMB border deselects.

Many times it is necessary to select everything in a scene, or to make sure that nothing at all is selected. The A-key can be used for that. Pressing the A-key while even a single object is selected will clear all selections. However, when nothing is selected, the A-key selects all objects in the Scene. It is quite common to find experienced Blender users pressing the A-key twice in rapid succession, once to clear all selection, and again to select all.

Callout: A-key selects everything in a Scene if nothing is currently selected. Otherwise, it clears all selections.

Once your scenes start to become more complex, it can be difficult to select everything you would like to "by hand". Blender has additional selection tools located in the Select menu in the 3D View header. You can select objects that are grouped together, objects of certain types like Meshes, Lamps and Armatures, objects that have the same materials, and in a variety of other ways. Make sure to explore the Select menu at some point!

Snapping

Figure OMD.6: The snapping menu.

The key command Shift-S pops up a snapping menu. In Blender, as in many art and drawing packages, "snapping" refers to moving things to a specific, predefined location. From this menu, you can choose to have the 3D Cursor snap to the location of the selected object. If you have more than one object selected, the 3D Cursor will move to the average location of all selected objects. You can also choose to have the selected objects snap to the location of the 3D Cursor.

The standard workflow for moving one object to the exact location of another object is to first snap the 3D cursor to the object you are targeting, then select the object you would like to move and snap it to the new location of the 3D Cursor.

Callout: Shift-S in the 3D view brings up the Snap menu.

Object Information

There are a number of ways to find out information about the objects you have selected, but the simplest way is through using the Transform Properties panel. Within the 3D view, pressing the N-key brings up a panel that contains information about the Active Object. There are other screens in Blender that use the same hotkey to bring up a properties panel for selected objects, like the Ipo Window and NLA Editor. Pressing the N-key again will hide the panel.

Figure OMD.13: The Transform Properties panel.

The panel shows the current location, rotation, scale and overall dimensions of the object. In addition to simply showing information about the object, the panel can also be used to change those values. Each of the controls is a spinner, allowing you to either LMB click on the value itself to type a new one, LMB click on the right and left arrow to raise and lower the value, or to LMB click and drag inside of it.

In addition, any of the values can be locked by LMB clicking on the grayed-out lock icon beside its spinner. Locking a value on the transform panel will prevent the object from being moved, rotated or scaled along that axis. For example, if you had an object like a sliding door that was supposed to only move left to right, you could lock both its z and y axes so that it could only be transformed along the x (left/right) axis.

Callout: N-key toggles the Transform Properties panel in the 3D view.

Transforming Objects

Objects can be transformed ("transformed" is an overall term for moving, rotating and scaling) in a number of ways. As seen above, location, rotation and scale can be changed by entering values in the transform properties panel. Of course, this being an interactive 3D application, these transformations can also be accomplished visually - and much more intuitively - in the 3D view.

Transforming with Hotkeys

Often, the fastest method for transforming objects is to use the hotkeys G (for Grab/Move), R (for Rotate) and S (for Scale, or Size). When you use the transform hotkeys, the selected object (or objects) enters a transformation mode that allows you to move it freely with the mouse. If at any time during a transform you want to cancel the operation, click the RMB. When you have the object transformed as you like, clicking the LMB accepts the operation.

Callout: G-key lets you translate (move) an object. R-key lets you rotate an object. S-key lets you scale (resize) an object.

While you are transforming an object, it is often useful to limit the change to a certain axis. For example, if you are trying to make an egg shape from a sphere, you would only want to scale the sphere along, say, the z axis, creating an oblong, egg-like shape.

This sort of transform limitation is accomplished with the X or Y or Z-keys, used while the object is in transformation mode. So, to move an object only along the Z axis, you would press the G-key, followed by the Z-key. Using Shift with the axis keys does the opposite, allowing an object to transform along the other two axes. For example, pressing the G-key, followed by Shift-Z, would allow the object to move freely in along the X and Y axes, while not allowing vertical (Z axis) movement.

Callout: X, Y, or Z-key constrains transformation to each axis. Shift-X, Y or Z constrains transformation within each plane.

Of course, there is more than one way to do this in Blender. Pressing the G-key (or R or S), then beginning a transformation and clicking the MMB will constrain the object's transformation along whichever axis you have begun the motion. Clicking the MMB again while still in transformation mode removes the constraint, giving you complete freedom of movement again.

There is one further way to limit transformation with these hotkeys, and that is to press the axis key (X, Y or Z) not once, but twice. The second key press causes the object to use what is called the "alternative transformation space". Which alternative space is used is defined in the header of the 3D Window, and can also be set by the Alt-Spacebar hotkey.

Figure OMD.14: The Alternative Transformation Space menu on the 3D header.

In the case of a rotated cube, transforming the cube with the G-key followed by the Z-key will move it directly upwards in the scene. However, with the alternative transformation space set to "Local", a second press on the Z-key will move the cube vertically in relation to its current orientation.

Figure OMD.15: A cube is shown moving away from the origin, constrained in both Global and Local spaces.

Callout: Pressing one of the axis constraints (X, Y, Z-key) twice during transformation constrains the transform to each axis in the alternative transformation space, which is local space by default.

Transformation Center

When rotating or scaling objects, Blender, by default, causes the rotation or resizing to occur relative to the object's center. Pressing the R-key on a cube, then moving the mouse will cause the cube to rotate in place, around its own center. But what if you want to use a different center point for rotation or scaling? Blender can be set to use several different methods for determining what to use as an object's transformation center, all accessible in the "Rotation/Scaling Pivot" menu in the 3D view header.

Figure OMD.15.1: The Pivot Point menu on the 3D header.

Although each option in this menu is useful under certain circumstances, the two most commonly-used are "Bounding Box Center" (the default), and "3D Cursor". In fact, each of these options has a hotkey attached to it: Comma-key (",") for Bounding Box Center, and Period-key (".") for 3D Cursor. It is not unusual to see an experienced modeler or animator rapidly switching between these two modes when making transformations.

Figure OMD.15.2: Two cubes, the left rotating around its Bounding Box Center, the right rotating around the 3D cursor.

The "Bounding Box" referred to above is just the outer limits of an object.

Figure OMD.16: Several objects with their bounding boxes showing. Note how the cube's bounding box is just itself.

Of course, you already know how to set the location of the 3D Cursor (LMB). A word of warning when using the 3D Cursor as the pivot point for a rotation or scale transformation: make sure you set the 3D Cursor from two different views (like front and top). If you set it in front view alone, it will only set the 3D Cursor's x and z coordinates, leaving its y coordinate unaltered. If that y coordinate is drastically offset from the object you are transforming, it can lead to unexpected (read: bad) results.

Callout: Change the rotation and scaling pivot point through the menu on the 3D header, or with the hotkeys Comma (for Bounding Box Center) and Period (for 3D Cursor).

Transform Manipulators

In many cases, using the G/S/R hotkeys for transformation can be the most efficient method. However, it is not for everyone, and Blender provides tools that can accommodate many different working styles.

The graphical transformation manipulators give users direct, mouse-based access to all of the transformation controls. The manipulator is turned On by default, and can be switched on and off either through its button on the 3D View header, or by choosing "Enable/Disable" from the Ctrl-Spacebar menu in the 3D View.

Figure OMD.17: The Manipulator controls on the 3D header.

There are separate manipulators for movement (called translation), rotation and scaling. Each manipulator functions in a similar fashion: simply LMB-drag on the manipulator handle that corresponds to the axis you wish to transform. The rotation manipulator in particular gives excellent visual feedback, showing a "pie chart" representation of the current rotation.

Figure OMD.17.1: The three different types of manipulators.

Like many things in Blender, the transform manipulator icons on the 3D header can be Shift-clicked to build a selection, allowing you to show and use up to all three manipulator types (move, rotate and scale) at once.

One more interesting aspect of the visual feedback that manipulators give is that locking transformation in the Transformation Properties Panel (N-key, discussed earlier) actually removes that axis from the manipulator, making it impossible for you to use the manipulator to transform along a locked axis.

Callout: The manipulators provide direct, one-click access transformations.

We encourage you to become comfortable with the hotkeys G, R and S and the axis constraints (x, y, and z) before you start to use the manipulators. The manipulators are generally considered to be more intuitive, and in certain circumstances (like moving vertices relative to their normals during mesh editing and rolling and rotating bones in armatures for character animation) are perhaps the best way to accomplish the task.

If you find that the manipulators are not to your taste, you can get them out of the way (they can cause trouble with selections in cluttered environments) by disabling them with their button on the 3D Header or through the Ctrl-Spacebar menu. Don't forget they are there, though - they may come in handy someday. Whatever the case, make sure that you try out both methods of working so you can find the one that suits you best.

Clearing Transforms

Sometimes, it is helpful to completely remove any movement, rotation or scaling from an object. While this can be accomplished by entering zeros in the Location and Rotation sections of the Transform Properties panel and ones in the Scaling spinners, there is a simpler way. Adding the Alt key modifier to the transformation hotkeys clears that particular transformation. Alt-G returns the object to coordinates (0,0,0). Alt-R clears all rotations, and Alt-S sets any scaling that has been done to an object back to 1.

Callout: Alt-G clears all translations. Alt-R clears rotations. Alt-S clears scaling.

Applying Transforms

There are cases when you may have transformed an object by changing its scale and orientation in order to get it into a beginning state for animation or other work. Perhaps you imported a model of a car from an Internet repository, and it was of a completely different scale and rotation than the rest of your scene. Using the S and R-keys, you adjusted the model to fit in with everything else. When it was done, your Transform Properties panel looked like this:

Figure OMD.18: The Transform Properties panel.

You could proceed with the construction of the scene and eventually animate just like this. However, it would be nice when animating to start with a "clean slate," especially for rotations.

Pressing Ctrl-A and LMB clicking through the popup that reads "OK? Apply scale and rotation" will reset both Scale and Rotation values to their defaults (ones for Scale and zeros for Rotation), while leaving the object exactly as it appeared before.

Callout: Ctrl-A applies scaling and rotation to an object, resetting them to their base values without transforming the object.

Duplicating Objects

There are two ways to duplicate objects in Blender, each suited to a slightly different task. The first is the standard duplication which is accomplished by selecting an object (or objects) and pressing Shift-D. This creates a full, independent copy of the object, including any data, such as mesh data, that might be linked to it. The new object can be edited without affecting the original.

Callout: Shift-D creates a complete duplicate of the selected object.

The other method of duplication uses Alt-D instead, and creates a new object whose data is still linked to that of the original. For example, a duplicate of a Mesh object that was created with Alt-D will actually share the mesh with the original. If the Mesh of either object is modified in Edit mode, the change will show up in both objects, in real time. One excellent use for this method of duplication is for lighting setups: creating a series of Alt-D duplicated lamps would allow you to adjust the lighting intensity on one lamp and have that change used for all of the duplicates.

Copies made with Alt-D are referred to as "linked duplicates".

Callout: Alt-D creates a duplicate of the selected object, but shares any object data (mesh shape, lamp settings, etc.) with the original.

Parenting

Many graphics applications allow you to create parent-child relationships between objects. In a parent-child relationship, any transformations that you perform on the parent also happen to the child. In fact, when transforming a parent, the child is transformed as though the parent and child together were a single larger object, with the parent's center being the overall center of the object. For example, rotating a parent will cause not only the parent to rotate, but the child to move in a curve through space, as though they were connected by a rigid bar. Directly transforming a child object still works as you would expect, but it has no effect on the parent.

Figure OMD.18.1: When the central parent object is rotated, the child follows as though it were part of the parent.

To create a parent-child relationship, select more than one object, press Ctrl-P, then LMB to accept the "OK? Create parent" prompt. The active object becomes the parent, and any other selected objects become the children. A dashed line appears between parent-child sets, allowing you to visually keep track of which object is related to which.

To clear a parent-child relationship, select the child object and press Alt-P.

Perhaps the best way to get the hang of parent-child object relationships is to create two Blender objects, give them a parent-child relationship with Ctrl-P, then begin transforming them.

Callout: Ctrl-P causes the active object to become the parent, and any other selected objects to become the children in a parent-child object relationship. Alt-P removes the parent-child relationship.

Layers

Complex scenes can quickly become cluttered with mesh objects, lamps, placeholders and guidelines. When that happens (well, actually before that happens) it becomes useful to sort your scenes into groups of objects that can be selectively hidden when they are not needed. This kind of grouping is best accomplished in Blender through Layers.

Figure OMD.19: The layer buttons.

The layer buttons on the 3D header indicate which layers are visible and which are hidden. Layer selection follows the same rules as object selection. Using LMB on a layer makes it the current selection, clearing all others, meaning that objects on that layer become visible while all others are hidden. To make several layers visible at once, you build a layer selection by holding down Shift while using the LMB. Shift-LMB more than once on the same layer button will toggle it on and off.

An object may be placed on a layer either by clicking the appropriate layer button in the Draw panel of the Object Buttons (F7), or by pressing the M-key in the 3D View to bring up a layer button pop up.

Figure OMD.19.1: The same set of buttons is used whenever dealing with layers.

Callout: Which layers an object appears on is set from the Draw panel, or in the M-key popup in the 3D view.

Objects can be set to appear on more than one layer. For example, in the case of a farm scene, the farmhouse itself could reside on all layers, while fencing, grass, a barn and animal objects could each reside on their own layers. Having the farmhouse appear in all layers can provide you with a good reference for positioning all the other objects.

In addition to directly clicking on the layer buttons, layers can be activated and set through hotkeys. The keypad numbers 1 through 9 and 0 (which functions as 10 here) are the equivalent of clicking on layer buttons 1 through 10, activating the appropriate layer. Holding Shift with 1 through 0 has the same effect as is it does when clicking: it builds and subtracts from the layer setting. Alt-1 through Alt-0 access layers 11 through 20. The "set to layer" M-key popup can also be controlled with the same number keys if you wish.

Sometimes, you may be performing an operation with the keyboard in Blender, and suddenly, your entire Scene seems to disappear. Often, it may be that you have accidentally pressed one of the number keys on the main keypad, telling Blender to show only objects on that layer. If your Scene disappears, don't panic - check the layer buttons on the 3D header. It could be that everything is all right, but simply hidden.

Callout: Layers can be selected and set through the keypad numbers 1-9 and 0, and Alt-1 through Alt-0.

Object Manipulation and Basic Animation

In this tutorial, you'll learn about object creation, manipulation and organization in Blender, as well as different techniques of object-level animation. In this tutorial, we will be make a model of a molecule that will allow us to experiment with different methods of creating motion through animation.

Use Ctrl-X to begin a clean session of Blender.

At this point, it wouldn't be a bad idea to review the interface elements for changing the 3D view (Numpad-1, 3, and 7 for front, side and top view; Numpad-5 to toggle into and out of perspective mode; Z-key to toggle shaded view, as well as the MMB and scroll wheel to freely zoom and rotate the view. If you haven't already worked through Chapter 2: The Basic Interface, now would be a good time to do so). Once you're done getting your 3D legs, its time to start creating your molecule.

Figure 1.01: The default 3D view, with a cube, a lamp and a camera.

First, you must get rid of the default cube. If your zooming about in the previous paragraph has resulted in the default objects being off screen, press the Home key and Blender will auto-zoom the view so that all objects are visible again. Now, press Numpad 7 to move into a top view.

Select the default camera by placing the cursor over it and pressing the Right Mouse Button (RMB). Many new users are thrown off by this unconventional selection method (many programs use the Left button for selection). Learn, right now, that RMB selects in the 3D view. When you RMB the camera, you will see that its outline is highlighted in light pink. This pink outline indicates that the object, in this case the camera, is selected.

RMB the cube and you will see that it is now outlined in pink (selected), while the camera has returned to its original state. Selection in Blender is accumulated like most other programs with which you are familiar, with the Shift key. With the cube still selected, hold down the Shift key and RMB the camera. Keep holding the Shift key and RMB select the default lamp. Your selection has been extended to all three objects: the cube, camera and lamp.

But you don't want all of that to be selected. You only want the cube selected.

Figure 1.01.11: The default scene with everything selected. Figure 1.01.12: The default scene with nothing selected.

Press the A-key. A-key toggles selection on and off for everything. Pressing A-key once selects everything (you can think of it as 'select All'). Pressing it again deselects everything. Do you want to make sure that nothing is selected? Press A-key twice.

Of course, when you just pressed the A-key, everything most likely deselected. Why? Well, remember that by Shift-RMB clicking you had already selected all the objects in the Scene. So, if nothing is selected, you're where you need to be. If instead everything is selected, press the A-key one more time. Get the current scene to a point where nothing is selected. Now, you'll learn one final method of selection.

With your cursor over the 3D window, press the B-key, and watch the cursor become the target of moving crosshairs. These moving guidelines indicate that you are in Border Select mode. Simply LMB click and drag across the 3D window, and any object that falls within the area of the box shape that your dragging creates becomes selected when you release the mouse button. Unlike RMB selection, border select is always cumulative and will add to your previous selection. If you want to use border select to deselect objects, then drag with either the MMB or RMB instead of the LMB.

You might want to try using the B-key and border selecting objects for practice, clearing your selection each time with the A-key.

When you're done, use the selection method of your choice to select only the default cube.

Press the X-key to delete the cube. You will be prompted "OK? Erase selected object(s)". Click the LMB to accept this and erase the cube. Over time, you will probably find that the combined motion of X-key/LMB to delete an object will become second nature, and that you'll probably forget there's a click-through confirmation there.

Callout: Right Mouse Button selects in the 3D view. Shift-RMB builds selection. A-key toggles between Select All and Select None. B-key enters border select mode. Dragging with LMB selects. Dragging with RMB/MMB deselects. X-key deletes selected objects.

Undo

But wait, you didn't want to remove that cube! Why? Well, let's pretend for a second that the cube was in fact a head model that you've just worked on for eight hours straight without saving once. And you accidentally deleted it.

Ctrl-Z, like in many other programs, is Undo. Press Ctrl-Z to bring the cube you just deleted back from the great digital beyond. Ctrl-Shift-Z is the Blender equivalent of Redo, sending the cube back to the netherworld. Unlike other programs, however, there is no menu entry for Undo or Redo, so learning to use the hotkey combination for this one is essential.

The 3D Cursor

Figure 1.02: The 3D cursor.

The 'aiming sight' that you've seen hanging around in the 3D view is the 3D cursor. The 3D cursor is where new objects and items will appear when created in the 3D workspace. It can also be used to control how objects rotate and scale.

If you're like most new Blender users, you've mistakenly LMB clicked somewhere in the 3D view, hoping to select something (and select is RMB, remember?). Using LMB in the 3D view sets the location of the 3D Cursor. Before you begin creating your first model, we'd like to make sure that the 3D Cursor is in the center of the 3D world.

Go into front view (Numpad 1) and LMB as close to the center of the intersection of the blue and red (z and x) axes as you can. The 3D Cursor jumps to the position of your click. Now go into side view (Numpad 3) and LMB once again at the intersection of the blue and green (z and y) axes, if the 3D Cursor isn't already there. Use Numpad 1 to return to a front view. Great. Now you're set.

We wanted you to practice using the LMB to set the 3D Cursor in the previous example, but there's an even easier way to return the 3D Cursor to the origin. Shift-C snaps the 3D Cursor to the center of the 3D world.

Callout: LMB in the 3D view sets the location of the 3D Cursor Shift-C centers the 3D Cursor in the global workspace.

Adding Objects

With the cursor over the 3D window, bring up the toolbox by pressing the Spacebar.

Figure 1.03: The toolbox, about to add an Icosphere.

As you can see in the illustration, there are many different kinds of objects you can add to the 3D view, but for this chapter we're going to focus on the Mesh category. From within the Add->Mesh section of the toolbox, choose Icosphere, then click OK when a pop-up says 'Subdivision: 2". You've just added a mesh sphere object to the 3D world, and it has been created at the location of the 3D cursor.

Note: If you've done this, but don't see anything resembling a sphere on your screen, you may be zoomed in or out too far, or have panned the view too far off to one side. Try pressing the Home key, which will auto-zoom and pan the view to show all available objects.

The icosphere will most likely be a lavender or purple color with yellow edges covering its surface. This is because new objects are created in Edit Mode, which allows you to change the mesh's shape and geometry. You won't be dealing with that yet, but you can learn about it in Chapter 4. For now, get out of Edit Mode by pressing the Tab key. When you do it, the mesh lines disappear, the faces turn gray, and the entire object is given a light pink outline. If you'll recall from earlier in the chapter, that pink outline indicates that the icosphere you just created is currently selected.

So, adding a new object does three things: 1. Creates a new object wherever the 3D Cursor is; 2. Puts the object in Edit Mode (if such a thing is possible for that object. For example, Lamps do not have an Edit Mode); 3. And automatically selects the new object.

Just to give you enough examples to work with, your sample atom will have three protons and three neutrons in its nucleus, so you're going to need to create a few more objects. If you just added several more with the spacebar toolbox right now, they would all be created at the location of the 3D cursor, meaning that they would be created in the same space as your first icosphere. Of course, this is a virtual world, so doing this won't hurt anything. It would only make it difficult to keep track of how many objects you have and where they are. You already know how to set the location of the 3D Cursor, so go ahead and reposition it away from the first sphere.

Figure 1.04: The 3D cursor positioned away from the icosphere.

LMB a short distance away from the original icosphere. Then, use the spacebar toolbox to add another icosphere. Don't forget to hit Tab afterward to get out of the default Edit Mode.

Getting Oriented

Before you start moving things around, you need to get oriented in 3D space. Use Numpad-1 to make sure you are looking at the scene from the front. Notice the little icon in the lower left of the view: a vertical blue line labeled Z that meets a horizontal red one labeled X.

Figure 1.05: The axis icon in the 3D view.

This icon is to help you remember that the x axis runs left to right, and the z axis runs bottom to top. Press Numpad-3 to move into side view, and you will see that the icon still shows the z axis, but now also shows the y axis. The y axis runs from back to front.

If you're completely new to 3D, a little explanation is in order. An 'axis' is a convenient way to refer to a direction. 3D objects are located by finding their location along each axis. A more detailed explanation is in the discussion section of this chapter if you should need it.

Figure 1.06: [no text]

In the illustration, the object is said to be located at (3,2,4), with each of those numbers corresponding to its location along the respective axes (x,y,z).

So, in Blender, the axes are: X: left/right Y: back/front Z: bottom/top

This will have to become second nature to you, and, if you use the keyboard shortcuts for object manipulation and again later for modeling, it will.

Moving, Rotating and Scaling Objects

There are three main things you can do to an object once it has been created. Move it around, rotate it, and change its size (usually called scaling). All together, these kinds of changes are referred to as "transformation".

RMB on one of the icospheres to select it.

To rotate the icosphere, press the R-key. Now start moving the mouse in circles around the icosphere. You will see it rotate to follow your motion. When you're done, RMB will cancel this rotation mode, returning the sphere back to its original orientation. Try it again, by hitting R-key, then rotating, but this time, end the motion with the LMB instead. The sphere leaves rotation mode, but now stays wherever it was when you hit LMB.

This is the main workflow for manipulating objects and using tools in the 3D workspace throughout Blender. A hotkey (R in this case), followed by a mouse motion, ending either with RMB to cancel and return to the previous state, or with LMB, which confirms the change.

Since the R-key triggered a rotation, any guesses as to how to go about scaling an object?

S-key, followed by mouse motion, ending in either LMB (accept) or RMB (cancel). Try scaling one of the spheres. Select it, use S-key, and make it grow to twice the size of the other. LMB to accept the change.

Figure 1.07: The original sphere, scaled to double its size.

Now, use the same procedure to try to return that icosphere close to its original size. If things get really messed up, remember that you can use Ctrl-Z to Undo.

And finally, movement. In Blender, although R rotates and S scales, it is the G-key that moves objects. G stands for what? Most Blender users think of it as "Grab". If it helps you to remember it, you can too.

Select your icospheres and use the G-key to move them around. Once again, RMB cancels the movement, resetting things to how they were before you pressed G, while LMB accepts the movement.

Now, let's put your knowledge of the axes (x,y,z) to work in conjunction with these basic motion tools.

Using the MMB, click-drag in the 3D window to rotate the view until you have something similar to this (it doesn't really matter as long as you have a nice angled view).

Figure 1.08: [no text]

Select one of the icospheres and press G-key to "grab" and start moving. While you're still in Grab mode, moving the sphere around, press the X-key. Suddenly, a line appears through the sphere, running parallel to the X axis, and you find that the object will only move along that line. You have constrained the object's motion to the x axis. Now, without RMB canceling the movement, press the Y-key. The guideline shifts to parallel the Y axis, and the motion is constrained to only front/back. You know what the Z-key will do.

So you see that if you want to move an object up a bit, you select it, press the G-key, then press the Z-key. When you do that, you can be sure that the object will only move up and down. And that's why it's important to learn which axes are which when you are moving things around. You will not always be in one of the straight-on views (front, side, top, etc.), and it can often be essential to be certain of which direction you are moving things.

Callout: G-key lets you move (Grab) an object. R-key lets you rotate an object. S-key lets you scale (resize) an object. With these operations, LMB accepts your changes. RMB cancels and returns the object to its original state. While in any of these transformation modes (G/R/S), pressing the X, Y or Z-keys constrains you to transforming along that axis.

Manipulators

You've eaten your vegetables and learned the main hotkeys for transforming objects in Blender. Let's look at two alternate workflows for doing the same thing that may suit your way of thinking better.

With the 3D window still at an angled view, re-examine the selected sphere.

Figure MG.01: [no text]

Those red, blue and green arrows sprouting from the center of the sphere are its translation manipulators. LMB click and drag on the blue arrow head.

The sphere moves along the z axis (vertically). When you release the LMB, the motion stops and the sphere comes to rest in its new location. Try it with the green and red arrow heads. Each one controls translation along a different axis.

Now, take a look at the manipulator controls on the 3D view header.

Figure MG.02: The manipulator buttons on the 3D header.

Each button enables a different manipulator, all of which function the same way: LMB and drag. Particularly useful are the visualizations for the rotation manipulators, which actually show the growing angle as you rotate the object.

Just like holding down the Shift key with RMB builds a selection of 3D objects, holding down Shift while clicking the manipulator buttons in the header builds a selection there as well. In fact, by using Shift-LMB, you can enable all three manipulator types at once, giving you quick access to all transformation features directly in the 3D view.

Figure MG.03: The Combo Manipulator.

Give them a try. They might fit the way you work better than the hotkeys. Later on, during character animation and certain kinds of mesh modeling, there are tasks for which the manipulators are very well-suited. Of course, the manipulators are not for everyone, and if you find that you don't care for them and would prefer to have them out of your way, you can. The "pointing finger" icon, shown in the illustration, will turn the manipulators off.

Gestures

Blender also allows users to trigger the basic transformations through mouse gestures. Try this: RMB select one of the spheres. Now, LMB click and drag, slowly carving a circle like this:

Figure MG.04: [no text]

When you release the LMB, you will find that the sphere is now in rotation mode as though you had pressed the R-key. Using the LMB again will confirm the rotation, and RMB will cancel it.

The other mouse gestures are:

Figure MG.05: Translate

Figure MG.06: Scale

Some experienced Blender artists swear by the mouse gestures, as they allow them to position and construct their scenes with minimal interaction from the keyboard. They are not for everyone, but definitely worth a try!

Duplication

Back to our atomic example. To make the little atom have the right stuff inside, it will need three protons and three neutrons. You could move the existing icospheres away from the 3D Cursor and add four more from the toolbox. Or, you could make use of what you already have.

RMB select one of the icospheres, then press Shift-D.

Shift-D duplicates the selected objects. The duplicate object is created at the location of the original object, and is put into Grab (move) mode. Move the new object away from the original and press LMB to lock it into position. Note that pushing RMB to cancel Grab mode after duplication does not cancel the duplication. A duplicate will still have been made, but will be "hiding" at the exact location of the original. For that reason, if you accidentally duplicate an object, it's better to get into to the habit of moving it away from the original, LMB, then deleting it with the X-key.

You need a total of six icospheres to make up the atom's nucleus. RMB select one of the icospheres you have so far. Next, use the B-key area selection method to select the other two as well. If you accidentally select the camera or lamp object, you can remove them from the selection by holding down the Shift key and RMB (probably twice) on them until they are no longer outlined in pink. Alternatively, you can press the A-key twice (once to select All, and again to deselect everything), then begin from scratch.

When you have the three icospheres (and nothing else) selected, press Shift-D to duplicate all three at once.

Using different views (Numpad 1,3,7 and MMB drag), the Grab/move tool and the x, y and z movement constraint hotkeys (or the manipulators!), move the six icospheres together to form a nice, messy, nucleus. It doesn't matter if it matches the illustration or not. The point is for you to start to become familiar with the tools you will be using all the time.

Callout: Shift-D duplicates selected objects.

Figure 1.9: The completed nucleus.

Moving On

At this point, it's best to spell out what goals we would like you to accomplish to get the big picture. You still need to add three electrons and animate them so they fly around the nucleus. It would also be nice to add some sort of animation to the nucleus as a whole, so it's not just sitting there in quantum laziness the entire time.

Before you begin animating, you should adjust your workspace to one more suitable to the task than the one you've been using up to this point. Do you remember from the Interface chapter that Blender's workspace is highly configurable, and that the default installation comes with several different screens, each suited to a different task? Now's the time to start making use of it.

Use the Ctrl-Left Arrow hotkey to change working screens. If you are using the default Blender installation, this hotkey will have placed you in a screen labeled "1-Animation". Alternately, and a little more slowly, you could have chosen that option from the Screens drop down in the main header.

Figure 1.10: Choosing the Animation screen from the header.

Figure 1.11: The default Animation screen.

Lots of new stuff here, but no need for panic. In fact, the only really important stuff you'll be dealing with right now is the timeline, the 3d view (which you already know), and something called the Ipo view.

Figure 1.11.1 The Timeline window.

The timeline is pretty self-explanatory. It is the timeline in seconds over which your animation takes place. Controls on the timeline are simple as well. Start and End represent the start and end frames of the animation, and can be changed by clicking on them and entering new values. The "play" button plays your animation in the 3D view. Pressing it again halts animation. The "skip to start/end" buttons do exactly as advertised. LMB dragging within the timeline window plays through any animation you have created in other windows. Moving through an animation by dragging the mouse over a timeline is known as "scrubbing".

The timeline can display either seconds or frames. With the cursor over the Timeline window, the T-key toggles between these display methods. Press the T-key and choose "Frames" for now. (If you're completely new to animation and need an explanation of time in animation and what the term "frame" means, check out the "Frames and Time" sidebar.)

Sidebar: Frames and Time

In animation (and television and film), time is divided into Frames. Each frame is a still image that represents a slice of time. When played one after the other quickly enough, these individual frames give the illusion of motion.

Different media have different frame rates. For most film productions, each second in time is divided into 24 frames. The common terminology is to say that film runs at 24 frames per second.

For North American television (NTSC), the rate is 30 frames per second (fps).

For European TV (PAL format), the rate is 25 fps.

It is important that you know your target media before you begin to animate, as changing the frame rate mid-way through an animation can lead to poor results, as objects and effects animated at a different frame rate will appear unnatural.

End sidebar

Empties

Sometimes, it would be nice to create an object that you can animate or use as a reference, but that you won't need to render. A simple mesh could be used, but it would be even more efficient if there was a type of "placeholder" object. What would something like that be useful for? Well, let's say that you would like to make the entire nucleus of your atom pulsate (shrink and grow repeatedly). Since the nucleus consists of a number of objects, you would like to have a way to only animate such an effect once, as opposed to animating each object individually. In Blender, placeholders to help with such things are called Empties. You create an Empty object, then animate it to grow and shrink. Afterward, you get all the parts of your nucleus to follow that animation.

Let's add an Empty to your Scene.

First, to make sure that you can see it clearly when it's created, LMB somewhere away from the icospheres, setting the 3D cursor. Then, use the toolbox to Add->Empty. The Empty appears at the location of the 3D cursor, like any other new object.

Figure 1.12: The toolbox, about to add an Empty to the scene.

Now, let's do your first bit of animation. In Blender, as in most 3D animation programs, animation is accomplished by changing the location, rotation or scale of an object over time. The markers that keep track of these changes are called Keys.

In the Timeline window, make sure that the green time marker that indicates the current time is as far left as it will go. This should put you on Frame 1 of your animation.

Move the cursor over the 3D window and press the I-key. A menu titled "Insert Key" pops up. Choose "Scale" from the menu, as you are going to only animate the scale of this empty.

Figure 1.13: The Insert Key menu, prepared to set a Scaling key.

Back in the Timeline window, LMB around frame 80, setting Blender's frame counter to 80. Over the 3D window, press the S-key and scale the Empty up to twice its original size. LMB to confirm the change in scale. Now, press the I-key again and choose "Scale."

You will notice that the timeline now contains two small yellow lines, one at the location in time of each key you just set (i.e. one at frame 1, and one around frame 80). Use the LMB to scrub the timeline between these two yellow markers. Watch the 3D view as you do it. You will see the Empty change scale as you scrub back and forth.

As you can see, the Start and End frames for your animation are set to the defaults of 1 and 250, and you need to set a few more keys to fill out the space. Continue positioning the frame counter in the timeline with LMB, then scaling the Empty and inserting Scale keys for it. As you will see, fewer keys in the timeline will result in slower animations, while dense groupings of keys will lead to rapid changes. Remember to press the timeline's play button to have Blender play back your animation for you. Really, it doesn't matter how many keys you insert, or how you decide to scale the empty in this step. If you're the kind of person that needs detailed Instructions though, try setting a new key every twenty frames, alternating between a large scaled empty and a small scaled one.

Note: Another popular method of playing back your animation is to position the cursor over the window you would like to see animated (most likely the 3D view), and pressing Alt-A. Pressing Alt-Shift-A will accomplish the same thing, but will run the animation in all windows on the current screen.

Now you have your Empty shrinking and growing. In the next step, you'll connect the spheres of your nucleus to it.

Callout: I-key brings up a menu of available properties on which to set animation keys. Alt-A plays animation in a particular window.

Parenting

In the real world, children inherit traits from their parents. In the world of 3D graphics, you can give your objects parent-child relationships. A child object will inherit certain characteristics (like scaling) from its parent: if the parent object scales, so will the child. The child can have its own characteristics -- it can move, rotate and scale on its own -- but anything that its parent does, it will do too. So, if you have an Empty with animated scaling like you just created, making that Empty the parent of your sphere nucleus objects should cause them to scale just like it.

Before you do the next bit, let's make sure that nothing is selected. Press the A-key twice to clear any selections that are currently made. Use the method of your choice (RMB, B-key border) to select all the icospheres that make up the nucleus of your atom. Then, holding down the Shift key, RMB select the Empty.

Note: Something we haven't mentioned before is the distinction between "selected" objects and the "Active" object. Notice how the Empty, which was selected last, is a brighter shade of pink than the other selected objects? This brighter selection indicates that the Empty is the "Active" object. The Active object will always be the last one that you select. Having an Active object is important when you will be performing an operation (like Parenting) in which one or more objects will be linked or referenced in some way to a target object. That target will always be the Active object.

So, with all of your icospheres selected, and with the Empty as the Active object, press Ctrl-P and click through the "OK? Make Parent" message that comes up.

Figure 1.14: The lines indicating a parent/child relationship are highlighted here.

The icospheres are now the child objects of the Empty. In some tutorials and references other than this book, they are said to be "parented" to the Empty, even though they are its children. Although that is a common usage, it is technically inaccurate and counterintuitive so we will avoid it here.

RMB select the empty, and use the G-key grab tool to move it around the 3D view (then RMB to cancel the move). The spheres move with it. Use the R-key to rotate the empty and see how the spheres move with it again (then RMB to cancel). RMB select one the icospheres and move it around by itself (don't forget to RMB to cancel the operation). Child objects can still be moved independently, but follow the motion of their parents.

Press the Play button in the Timeline window (or Alt-A over the 3D view) to see how parenting has caused the icospheres to inherit the scaling animation of the Empty.

Weird, huh? The icospheres grow and shrink with the Empty, but their distance from the Empty changes as well. That's not what you wanted. What is happening is that the children are changing size, but they are changing size as though they and the parent Empty are all one large object, growing and shrinking overall. Let's change this so it works correctly. If you wanted to, you could repeatedly use Undo (Ctrl-Z) to back step until the parenting relationship is removed.

Instead, select the icospheres and press Alt-P. An "OK?" menu pops up, with "Clear Parent" already selected. LMB to accept this (or you can press Enter on your keyboard for the same effect). The dashed lines that had been an indicator of the parent-child relationship have disappeared, showing that the spheres are no longer the children of the Empty.

To get the correct effect this time, you would like to put the empty in the middle of your nucleus, so that when it grows and shrinks, the nucleus will follow it properly. You could just use the G-key to position the Empty somewhere near the middle, but there is a more accurate way.

Callout: Ctrl-P creates a parent-child relationship between objects, with the Active object as the parent. Alt-P breaks the parent-child link of a selected child object.

Snapping

Select the icospheres of the nucleus. Press Shift-S. A "Snap" menu pops up, with five options. There are only two that you should really be concerned with: "Selection to Cursor" and "Cursor to Selection". Select "Cursor to Selection". This option places the 3D cursor at the center of the current selection.

Figure 1.14.1: The Shift-S snap menu.

So, how do you get the Empty to the exact center of the nucleus? Select the Empty (only the Empty, nothing else!), press Shift-S and this time choose "Selection to Cursor". This option moves any selected objects to the location of the 3D cursor.

You can see then that the workflow for precision movement in Blender is a two step process. First, position the 3D cursor via selection and Snap "Cursor to Selection". Then, Select the object you wish to position and Snap "Selection to Cursor".

In the example above, you've used the Snap menu to position your animated Empty in the center of the nucleus icospheres.

Use B-key to select the icospheres. The Empty, which was selected in the previous step, remains selected and is, in fact, the Active object, as you can see by its brighter color. (If the Empty is not the Active object, hold down the Shift key and RMB click it to make it so.)

With the icospheres selected and the Empty as the Active object, press Ctrl-P to create a parent relationship.

Figure 1.14.2: The spheres are now the children of the Empty in the middle.

Scrub the mouse back and forth in the timeline. This time, the scaling of the whole nucleus functions as you had hoped. At this point, if you wanted some extra practice, you could create a new Empty and animate it to pulse in a different fashion from the first. Then, you could make half the spheres the children of this new empty, leaving the others as the children of the original. This would create a more complex and hopefully more interesting animation.

Callout: Shift-S brings up the Snap menu.

Animation and Keys

Let's get a little more acquainted with Blender's system for creating keys for animation. To do this, you will add an electron to your atom and make it travel around the nucleus.

Figure OT.15: Set the 3D cursor away from the nucleus.

Before you do anything else, let's make sure that you are looking at your atom from the front - if you aren't, then some of the following examples will not quite work. Use Numpad-1 to go to a front view.

LMB to the left of the nucleus, setting the 3D cursor there, so that your electron is created at a good location. Use the spacebar toolbox to add an icosphere. Remember to use the Tab key after the object is created, to get out of Edit Mode. Really, you can add any kind of object you choose to experiment with, but our illustrations will use the icosphere. With the S-key, shrink the icosphere so it's a bit smaller than the ones already in the nucleus.

Make sure Blender's frame counter is set to 1 (use the Timeline view for this) and that only the electron is selected. Press the I-key and choose "Loc" (Location) from the Insert Key menu that pops up.

Figure 1.15.1: A new icosphere added to be the first electron.

LMB in the timeline to set the frame counter to somewhere around 60. Use G-key to move the electron to a position above the nucleus in the 3D view. Insert another location key.

Skip ahead to around frame 120, move the electron to the right of the nucleus and insert a location key. Finally, skip to around frame 180, move the electron below the nucleus and insert a key.

Figure 1.16: The position of the electron at different frame numbers.

Press the play button in the timeline or use Alt-A over the 3D view to play your animation.

Callout: I-key brings up the Insert Key menu, which lets you set animation keys for the Active object.

You'll see that this animation is not satisfactory for two reasons. First, the electron follows more of a diamond shaped path around the nucleus than a circle. Second, the electron stops below the nucleus, instead of continuing back through to its starting point.

First, let's round out the path that the electron follows. With the electron selected, press the K-key. Three olive-colored copies of the icosphere appear, one at each of the locations where we had set a key. The K-key toggles the display of keys in the 3D view.

Scrub with the LMB in the timeline until the electron is halfway between the left and upper keys.

Figure 1.17: The electron should be here to make a nice circular path.

If you try to use the G-key at this point, you will find that the icosphere does not move. This is because in this key view mode your transformations like move, rotate and scale only work on already set keys, not the actual object.

So, let's add a new key here, then move it to create a better circular path. Use I-key, and select "Loc" as before to insert a new key. Then with the G-key, move the key up and to the left. You will see the electron object move too, but this is only a result of moving the key. You are not moving the electron directly.

Now, as you scrub back and forth in the timeline, you can see the motion for this part of the animation is much closer to circular. Using LMB to move through the timeline, set new keys halfway between the other keys that have already been set, moving them slightly to make the entire animation more circular.

Figure 1.18: The new key positions are highlighted.

You have fixed the first problem with your animation. As you're finished with Key mode for the moment, use the K-key to exit that mode, hiding the keys in the 3D view. Let's move on to the second problem, which is that you would like the electron to end in the exact place it begins.

Callout: K-key toggles Key mode in the 3D view, which allows you to see and adjust key transformations directly.

Working in the Ipo Window

Figure 1.19: The Ipo window with curves from the orbiting electron.

Let's finally take a look at the Ipo window, shown in the illustration. The first thing to do is to make sure that your orbiting electron is selected in the 3D view. Then, place the mouse over the Ipo window and press the Home key. Recall that in the 3D view, the Home key zooms and translates the view so that every existing object becomes visible. It does the same thing in the Ipo window.

Figure 1.20: The Home key auto-zooms and pans a window to show everything.

The curves in this window represent the object's motion through space. You can see that there are three curves, each color coded to match one of the labels on the window's legend at the right. (If instead of colored curves you see a bunch of vertical yellow lines and gray curves, press the K-key. We'll explain in a moment.)

If you look along the bottom of the Ipo window, the ascending numbers indicate frames. Along the left side of the window is another scale that indicates values (locations in this case). So, LMB somewhere in the Ipo window to move the frame counter to that frame, just like the Timeline window. Use LMB to place the frame indicator line near frame 50. The legend on the right of the window tells you that LocZ (Location on the Z axis) is represented by yellow. In the Ipo window, then, find where the vertical frame indicator crosses the yellow curve. Look to the left-hand scale to see the approximate value of that orange curve at the intersection. In the illustration, it appears to be around seven.

Figure 1.21: [no text]

This means that at frame 50, the Z location value for the selected object is close to seven.

Remember how objects are created in the 3D view in Edit Mode, which allows you to change their shape and geometry? When working with 3D objects, you have always used the Tab key to return to Object mode. As with 3D objects, the Tab key also lets you enter and exit Edit mode on Ipo curves.

RMB on the LocZ (yellow) curve to select it (RMB functions as select in more than just the 3D view). Now, press the Tab key.

Users who are completely new to 3D probably aren't going to need to directly edit these Ipo curves for a while, but suffice it to say that the same tools that worked in the 3D view (Grab, Scale, RMB select, etc.) all work for editing and moving the points along the curves. Users who do want to edit curves directly like this will be helped by pressing the N-key, which pops up a panel that allows examination of and changes to the actual numeric values of the curve points.

You don't really need to edit anything here. The point is to show you that the curves are editable on a very fine level, if you should ever need to do so. Now that you've noted that, press the Tab key again to leave Edit Mode.

When we left the example, your first electron only went three quarters of the way around the nucleus. You would like it to end up exactly where it started so the circle is complete. Of course, you could just move it with the G-key and set a key frame, hoping to hit the same spot. Or, if you remembered the snapping functions of the 3D cursor, you could set the frame counter to 1, snap the 3D cursor to the electron; then advance to frame 250, snap the electron to the 3D cursor and set another key.

But just to demonstrate the use of the Ipo window, we'll accomplish the task there.

The Ipo view has another visualization mode - one that shows vertical markers on every keyframe. Just like the K-key showed keyframe markers in the 3D view, it does so in the Ipo window as well. Press the K-key, and your Ipo view changes to something like this:

Figure 1.22: The Ipo view in Key mode.

Each of those dull yellow vertical lines indicates that there is a key set on that frame. You're going to do some work in the window now, so use the mouse's scroll wheel to zoom the window out a bit. You'll need some unused space on either side of the first and last keyframes.

Select the vertical keyframe marker that sits on frame 1 by RMB clicking on it. Its yellow becomes brighter, indicating that it is selected. Recall that Shift-D duplicated an object in the 3D view. Press Shift-D with the key marker selected and the same thing happens: the set of keys marked by the selected line are duplicated and put into Grab mode. Move that Grabbed line to the right until it is over the indicator for frame 250, the last one in the animation.

You will notice as you move the line that a readout at the bottom of the window tells you how far you have moved. As you move the line, and before you use LMB to confirm the move, try holding down the Ctrl key. You will see that instead of moving smoothly, the line moves in steps, one whole number at a time. Using the Ctrl key during a transformation constrains the transform to operating in nice even steps, and can be very useful, for example, when trying to move something exactly 250 frames.

So now that you've duplicated the location keys from the first frame and moved them to frame 250, your animation starts and begins in the same place, meaning that it will work seamlessly if played in a loop.

Callout: Ipo curves are a graphical representation of each animated value of an object. Ipo curves can be worked with and transformed like any other Blender object, using the Tab key, RMB for selection, Shift-D for duplication and G-key and S-key for movement and scaling. K-key toggles between curve view and key view.

Layer Management

Most creative programs, 2D and 3D, have the ability to group objects by layers. Layers can help you to keep your workspace organized. Imagine a large scene based on a tourist attraction that includes a parking lot with cars, grass, a monument and models of people. When working on the monument portion of the scene, having the cars, grass and people cluttering the 3D view can be distracting and make work more difficult than it needs to be. If you put each set of objects into its own layer, it becomes possible to easily hide or show any set of objects as you need to work with them.

Let's create another electron, then start practicing with layers.

Select the already-existing electron and use Shift-D to create a duplicate, moving it about halfway toward the nucleus before using LMB to accept the move. Look at the Ipo window for this newly created and selected object. It contains the exact same animation curves as the original object. In fact, both the original and the duplicate object are linked to the same Ipo curves, meaning that if you were to play the animation right now, the duplicate object would immediately jump to the same position as the original and follow it exactly throughout the timeline. Obviously, you don't want that to happen.

To remove the link between your newly duplicated object and the old animation curve information, click the "X" beside the "IP: ObIpo.001" drop down menu in the Ipo window header. (If the dropdown doesn't appear on your Ipo header like it does in the illustration, try MMB dragging the header to the left to show additional header items.) This drop down menu contains all of the sets of animation curves you have created so far, including the scaling animation you did earlier with the nucleus' Empty parent. The "ObIpo.001" is just the name of this particular set of Ipo curves and can be changed to something relevant like "electronOrbit" if you so choose. In any case, clicking the "X" beside the name removes the link between your new object and the Ipo curves, freeing it up for other purposes.

Figure 1.22.1: Pressing the "X" will unlink the Ipo from the Object.

Placing the mouse cursor back over the 3D view, press the M-key. A little grid of twenty boxes and a large Okay button appear. Press the number 2 on your main keyboard (NOT the one on the Numpad), and hit Enter. The electron disappears. We'll find it in a moment.

Begin to RMB on the nucleus until you have the nucleus' parent Empty selected. Shift-D to duplicate the Empty and RMB again to cancel any movement of the duplicate. At this point our duplicate Empty is selected, but resting in exactly the same position as the original. Press the M-key, followed by 2 again, and Enter.

You may (or may not) suspect that you've just sent these two objects (the electron and the new Empty) to Layer 2 of your scene.

Figure 1.23: The "send to" layers popup palette..

Each Scene in Blender in comprised of twenty layers. An object can exist on several layers at once. You can set Blender to display any combination of layers that you need to see. In your current scene, the nucleus and first electron exist by default on Layer 1. You have placed the new Empty and second electron on Layer 2. Let's find them.

LMB on the button in the 3D window header that corresponds to Layer 2. Immediately, Layer 1 objects disappear and Layer 2 objects are shown. LMB on the Layer 1 button to go back to the original view. Like other selectors in the computer world, you can build a selection or take away from it by holding down the Shift key while selecting. Hold the Shift key and LMB on the Layer 2 block. Now, both Layer 1 and Layer 2 are showing.

Remember when you sent the objects to Layer 2? You simply used the number 2-key on the keyboard. That works here as well, and it would be a good idea to get in the habit of using the number keys to address layers. Just for fun, press the 1-key, then the 2-key. It has exactly the same effect as clicking on the buttons in the 3D view header. Now, hold down Shift while you press the 1 and 2-keys. It adds to and subtracts from the layer selection, just like the mouse clicks.

Sending objects to another layer is as simple as selecting the object, pressing the M-key to bring up the Move-to-Layer widget, then selecting the target layer and hitting okay. As with the earlier example, you can also use the number keys to assign a layer and the Enter key to accept the changes, meaning that you can keep your mouse cursor focused on your work. In fact, you will probably get to the point where layer assignment and selection is second nature - your fingers will just hit the right keys when you decide you want to work on a different layer.

Callout: Layers control which objects are displayed in the 3D view. Layers can be turned on and off either with their number keys or by clicking on the buttons. The Shift key adds to and takes away from layer selection. M-key in the 3D view pops up a layer button selector that is used to send objects to other layers.

Now that we've covered the basics of working with layers, let's look at a different method of making your new electron circle around the nucleus. This way builds on things we've already covered, and adds one more trick.

Figure 1.24: Layer 2 contains the Empty and Icosphere.

Using either the mouse, or the 2-key, show only layer 2 of your Scene.

Select the Empty. Before you do anything else, remember that this Empty is a duplicate of the one in the middle of your nucleus, meaning that it is still linked to the same scaling animation you made before. Go over to the Ipo window header, like you did with the duplicate electron, and break the link by LMB clicking on the "X" next to the Ipo name.

Now, make sure that you are on Frame 1. Use I-key and set a "Rot" (Rotation) key for the Empty. Pick a frame further on in the animation, say, 50 or so. Rotate the Empty along several axes, making it a fairly significant rotation from the original. Place another rotation key. If you like, play back the animation (Play in the timeline or Alt-A) to see the Empty do its rotation.

Now, switch your focus to the Ipo window, and use the Home key to make sure that it shows you everything that's available. You will see three curves, each representing the Empty's rotations along different axes. Use the A-key to make sure all the curves are selected (selected curves have white key points; unselected have black).

Figure 1.25: The Extend mode part of the Curve menu.

From the "Curve" menu in the Ipo window header, choose "Extend Mode", then "Extrapolation". On either side of the outermost keys, the curves turn into straight lines extending off into infinity. What does this mean? Play the animation now. The empty continues to rotate, even after the last frame with a key - Blender is extrapolating a continued animation based on the keys you had previously set.

Part two of this bit of animation is very simple. Return the frame counter to Frame 1. Select the electron, followed by the Empty (both should be selected, with Empty as the Active object). Use Ctrl-P to make the electron the child of the Empty. Play the animation and smile. That was easy.

Constraints

Before we end this basic discussion, we'll look at one more method of animating objects in Blender. This one doesn't even use key frames.

Return the animation to Frame 1. Duplicate both the Empty and the electron. You can select them both and use Shift-D, which creates two new objects with the same parent-child relationship as the originals. When you duplicate the objects, move them away from the others a bit so you have room to work.

RMB on the new electron and move it so its position relative to the new Empty is different than that of the original's, but try to keep it about the same distance.

Figure 1.26: The set of objects on the right are the new duplicates.

Now, RMB select the original electron, then hold down Shift and RMB on the new Empty. If you do it correctly, both the original electron and the new Empty will be selected, but the Empty will be the Active object (brighter pink). Use the keyboard combination "Ctrl-Alt-C", and a menu titled "Add Constraint to Active Object" will pop up. From this menu, choose "Track To".

Instantly, the empty rotates so that it points toward the original electron, moving its child with it.

Figure 1.26.1: [no text]

What you've just done is added something called a "constraint" to the Empty. Constraints are mostly used in Blender to limit or change locations, sizes and rotations of objects. In the case of the "Track To" constraint you just added, the constraint changes the rotation of the constrained object (the Empty) so that it always points to the target object (the original electron).

Notice in the buttons window below the 3D view how a Track To constraint has been added to the Constraints panel.

Figure 1.27: The Constraints panel in the Object buttons.

You could have used the "Add Constraint" button in this panel to do the same thing you've just done in the 3D view, but you would have had to fill in the proper object name in the panel's "OB:" field to get things to link up properly. Using selections and the Ctrl-Alt-C hotkey builds the constraint for you automatically.

Callout: Ctrl-Alt-C brings up the Constraint menu, which adds a constraint to the Active object, using the other selected object as its target.

What is the final effect? Move the new empty back to its original position (just using G to move it by hand will surely be close enough, but if you'd like to practice your precision movement, you can always use the Shift-S snap method described earlier). Play the animation.

The new Empty rotates, without any keys, so that it always points to ("tracks") the electron to which it is constrained. Its child electron, in turn, follows the Empty's rotation, most likely generating some neat orbital motion.

Finishing Up

Use Shift-1 (or Shift LMB on the layer 1 button) to add Layer 1 back to the display. Play the animation to see it in all its silly glory. While the animation is playing, you'll learn one more trick.

Let the animation run, and as it plays, try using the MMB-drag in the 3D view that you've used before to rotate your view. It works while the animation plays back! The other view translation controls work as well, although you'll have to use Ctrl-MMB for zoom, as the scroll wheel won't work in this mode.

Now that you've made three protons, three neutrons and three electrons in orbit, you have yourself a finished atom. If you would prefer to have some more practice, add some objects to the nucleus and toss in some more electrons until you have the element of your choice.

Rendering for Animation

In the Interface chapter, you rendered a still of the default cube which was, without a doubt, thrilling. Since you've just animated a nucleus, let's render it and watch it move.

On the far right of the 3D window's header (you may have to MMB-drag the header to see it) is a small Render icon. LMB click it.

Figure 1.28: The Render icon on the 3D header.

Almost instantly, the render window appears with a preview image of the Scene, drawn in whatever style (solid/wireframe) and from whatever perspective the 3D window is using. This sort of preview render (technically, it's called an "OpenGL" render) can be triggered from any 3D view by LMB on the render icon in its header.

Now, Ctrl-LMB on the same render icon. This time, the preview seems to animate, albeit slowly. What it's really doing is creating 250 OpenGL preview images and saving them somewhere (secret!) on your hard drive. If you don't feel like waiting for this to happen, you can cancel it (or any render, even one with a single frame) by pressing the Esc key.

When it has finished making the preview renders, you can press the Esc key to go back to the main Blender window. From there, find the Scene buttons (F10), and press Play.

Figure 1.29: The Play button in the Scene buttons.

A new window opens and your animation will play in a continuous loop.

Okay, that was the fast, crummy OpenGL preview render. It's great for checking your animation to make sure that everything is moving correctly, but not nearly suitable as a final product.

Chapter 12 contains full instructions for rendering animations to disk, so we're just going to take a shortcut here:

Zoom outward in the 3D view until you can see the Camera. RMB select it. Now, with the mouse still over the 3D view, press Numpad-0 to switch to the view from the camera.

Figure 1.30: The camera's view of the atom.

The outer solid border in this view represents the camera object itself and should be pink. If it's not, then you may not have the camera selected (just RMB on the solid border to select it). At the moment, your atom is most likely not in the center of the camera's view. Press the R-key twice to put the camera into an "aiming" mode and fiddle around by moving the mouse until your atom seems to be reasonably in the center of things.

Figure 1.31: The camera is now aimed a little better.

If you're up for it, and you have some time to kill, press the Anim button in the Scene buttons (F10). Blender will begin to actually render your scene, frame by frame. Even on a speedy computer, this will take several minutes, so go get yourself a drink.

When it's done, press the play button again to see the finished, rendered animation.

It doesn't look so hot, does it? Even rendered. Don't despair - you haven't learned modeling yet, or materials. Or lighting for that matter. But you know the basics of working with Blender objects and animation now, so the rest will come easily.