Sei sulla pagina 1di 20

Chapter 3: Object Manipulation and Basic Animation By Roland Hess In this tutorial, you'll learn about object creation,

manipulation and organizat ion in Blender, as well as different techniques of object-level animation. In th is tutorial, we will be make a model of a molecule that will allow us to experim ent 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 ch anging 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 a s the MMB and scroll wheel to freely zoom and rotate the view. If you haven't al ready 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 previo us paragraph has resulted in the default objects being off screen, press the Hom e 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 M ouse Button (RMB). Many new users are thrown off by this unconventional selectio n method (many programs use the Left button for selection). Learn, right now, th at RMB selects in the 3D view. When you RMB the camera, you will see that its ou tline 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 accumulat ed like most other programs with which you are familiar, with the Shift key. Wit h the cube still selected, hold down the Shift key and RMB the camera. Keep hold ing the Shift key and RMB select the default lamp. Your selection has been exten ded 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-k ey once selects everything (you can think of it as 'select All'). Pressing it ag ain deselects everything. Do you want to make sure that nothing is selected? Pre ss A-key twice. Of course, when you just pressed the A-key, everything most likely deselected. W hy? Well, remember that by Shift-RMB clicking you had already selected all the o bjects 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 o f selection. With your cursor over the 3D window, press the B-key, and watch the cursor becom e 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 be comes selected when you release the mouse button. Unlike RMB selection, border s elect 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 i nstead 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 def ault cube. Press the X-key to delete the cube. You will be prompted "OK? Erase selected obj ect(s)". Click the LMB to accept this and erase the cube. Over time, you will pr obably find that the combined motion of X-key/LMB to delete an object will becom e second nature, and that you'll probably forget there's a click-through confirm ation 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/MM B deselects. X-key deletes selected objects. Undo But wait, you didn't want to remove that cube! Why? Well, let's pretend for a se cond 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 eq uivalent of Redo, sending the cube back to the netherworld. Unlike other program s, however, there is no menu entry for Undo or Redo, so learning to use the hotk ey 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 curs or. 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 i n 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 posit ion of your click. Now go into side view (Numpad 3) and LMB once again at the in tersection 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 exa mple, but there's an even easier way to return the 3D Cursor to the origin. Shif t-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 Spaceba r. Figure 1.03: The toolbox, about to add an Icosphere. As you can see in the illustration, there are many different kinds of objects yo u 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, th en 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 curso r. Note: If you've done this, but don't see anything resembling a sphere on your sc reen, you may be zoomed in or out too far, or have panned the view too far off t o 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 c overing 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 t hat 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 tur n gray, and the entire object is given a light pink outline. If you'll recall fr om earlier in the chapter, that pink outline indicates that the icosphere you ju st 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. Fo r 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 f ew 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 th ey would be created in the same space as your first icosphere. Of course, this i s a virtual world, so doing this won't hurt anything. It would only make it diff icult 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 aw ay 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 to olbox 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 l ittle icon in the lower left of the view: a vertical blue line labeled Z that me

ets 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 sect ion 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 t hose 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 shor tcuts 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. Mo ve it around, rotate it, and change its size (usually called scaling). All toget her, 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 origi nal orientation. Try it again, by hitting R-key, then rotating, but this time, e nd the motion with the LMB instead. The sphere leaves rotation mode, but now sta ys wherever it was when you hit LMB. This is the main workflow for manipulating objects and using tools in the 3D wor kspace 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 origina l 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 Gkey that moves objects. G stands for what? Most Blender users think of it as "Gr ab". 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 ca ncels the movement, resetting things to how they were before you pressed G, whil e LMB accepts the movement. Now, let's put your knowledge of the axes (x,y,z) to work in conjunction with th ese basic motion tools. Using the MMB, click-drag in the 3D window to rotate the view until you have som ething similar to this (it doesn't really matter as long as you have a nice angl ed view). Figure 1.08: [no text] Select one of the icospheres and press G-key to "grab" and start moving. While y ou'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 t hat 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 o nly 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 ar e 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 obj ect 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 objec ts in Blender. Let's look at two alternate workflows for doing the same thing th at 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 mo tion stops and the sphere comes to rest in its new location. Try it with the gre en 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 manip ulators, 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 feature s 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 tas ks 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 pre fer 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 ges tures. 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 rotati on, 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 keyboa rd. 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 icos pheres 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 duplicatio n. A duplicate will still have been made, but will be "hiding" at the exact loca tion 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, t hen 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 obj ect, you can remove them from the selection by holding down the Shift key and RM B (probably twice) on them until they are no longer outlined in pink. Alternativ ely, you can press the A-key twice (once to select All, and again to deselect ev erything), 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 icosph eres together to form a nice, messy, nucleus. It doesn't matter if it matches th e 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 animat ion to the nucleus as a whole, so it's not just sitting there in quantum lazines s the entire time. Before you begin animating, you should adjust your workspace to one more suitabl e to the task than the one you've been using up to this point. Do you remember f rom the Interface chapter that Blender's workspace is highly configurable, and t hat the default installation comes with several different screens, each suited t o 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 d efault Blender installation, this hotkey will have placed you in a screen labele d "1-Animation". Alternately, and a little more slowly, you could have chosen th at 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 importan t 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 whic h 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 anima tion 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 anim ation by dragging the mouse over a timeline is known as "scrubbing".

The timeline can display either seconds or frames. With the cursor over the Time line window, the T-key toggles between these display methods. Press the T-key an d choose "Frames" for now. (If you're completely new to animation and need an ex planation of time in animation and what the term "frame" means, check out the "F rames 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 othe r quickly enough, these individual frames give the illusion of motion. Different media have different frame rates. For most film productions, each seco nd 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, a s 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. Wha t would something like that be useful for? Well, let's say that you would like t o make the entire nucleus of your atom pulsate (shrink and grow repeatedly). Sin ce 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 individual ly. In Blender, placeholders to help with such things are called Empties. You cr eate 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 ob ject. 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 p rograms, animation is accomplished by changing the location, rotation or scale o f an object over time. The markers that keep track of these changes are called K eys. 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 you r animation. Move the cursor over the 3D window and press the I-key. A menu titled "Insert Ke y" pops up. Choose "Scale" from the menu, as you are going to only animate the s

cale 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 counte r 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 a nd choose "Scale." You will notice that the timeline now contains two small yellow lines, one at th e 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 defau lts of 1 and 250, and you need to set a few more keys to fill out the space. Con tinue positioning the frame counter in the timeline with LMB, then scaling the E mpty and inserting Scale keys for it. As you will see, fewer keys in the timelin e will result in slower animations, while dense groupings of keys will lead to r apid 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 fra mes, alternating between a large scaled empty and a small scaled one. Note: Another popular method of playing back your animation is to position the c ursor 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 wil l 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 3 D graphics, you can give your objects parent-child relationships. A child object will inherit certain characteristics (like scaling) from its parent: if the par ent 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 do es, 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 cau se 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 y our choice (RMB, B-key border) to select all the icospheres that make up the nuc leus 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 sel ection indicates that the Empty is the "Active" object. The Active object will a lways 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 objec

ts 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 objec t, 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 he re. The icospheres are now the child objects of erences other than this book, they are said though they are its children. Although that inaccurate and counterintuitive so we will the Empty. In some tutorials and ref to be "parented" to the Empty, even is a common usage, it is technically 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 c ancel 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 fr om the Empty changes as well. That's not what you wanted. What is happening is t hat the children are changing size, but they are changing size as though they an d 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 "Cle ar 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 th e parent-child relationship have disappeared, showing that the spheres are no lo nger the children of the Empty. To get the correct effect this time, you would like to put the empty in the midd le of your nucleus, so that when it grows and shrinks, the nucleus will follow i t properly. You could just use the G-key to position the Empty somewhere near th e middle, but there is a more accurate way. Callout: Ctrl-P creates a parent-child relationship between objects, with the Active obje ct 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: "Sel ection 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 Empt y (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 cu

rsor. You can see then that the workflow for precision movement in Blender is a two st ep process. First, position the 3D cursor via selection and Snap "Cursor to Sele ction". Then, Select the object you wish to position and Snap "Selection to Curs or". 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 previou s step, remains selected and is, in fact, the Active object, as you can see by i ts brighter color. (If the Empty is not the Active object, hold down the Shift k ey 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 wh ole 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 fa shion 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 creat e 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 a nimation. To do this, you will add an electron to your atom and make it travel a round 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 f rom the front - if you aren't, then some of the following examples will not quit e 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 electr on 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) a nd that only the electron is selected. Press the I-key and choose "Loc" (Locatio n) 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 t o move the electron to a position above the nucleus in the 3D view. Insert anoth er location key. Skip ahead to around frame 120, move the electron to the right of the nucleus an

d insert a location key. Finally, skip to around frame 180, move the electron be low 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 e lectron 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 sel ected, 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 o f keys in the 3D view. Scrub with the LMB in the timeline until the electron is halfway between the lef t 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, mov e the key up and to the left. You will see the electron object move too, but thi s 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 thi s part of the animation is much closer to circular. Using LMB to move through th e timeline, set new keys halfway between the other keys that have already been s et, 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 Ke y mode for the moment, use the K-key to exit that mode, hiding the keys in the 3 D view. Let's move on to the second problem, which is that you would like the el ectron to end in the exact place it begins. Callout: K-key toggles Key mode in the 3D view, which allows you to see and adju st 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 firs t 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 t hat in the 3D view, the Home key zooms and translates the view so that every exi sting 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 s ee that there are three curves, each color coded to match one of the labels on t he window's legend at the right. (If instead of colored curves you see a bunch o f vertical yellow lines and gray curves, press the K-key. We'll explain in a mom ent.) If you look along the bottom of the Ipo window, the ascending numbers indicate f rames. 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 int ersection. 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 clo se to seven. Remember how objects are created in the 3D view in Edit Mode, which allows you t o 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 tha n just the 3D view). Now, press the Tab key. Users who are completely new to 3D probably aren't going to need to directly edi t these Ipo curves for a while, but suffice it to say that the same tools that w orked in the 3D view (Grab, Scale, RMB select, etc.) all work for editing and mo ving 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 ex amination 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 c urves are editable on a very fine level, if you should ever need to do so. Now t hat 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 wa y around the nucleus. You would like it to end up exactly where it started so th e 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 func tions 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 the re. 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 th at frame. You're going to do some work in the window now, so use the mouse's scr oll 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 dup licated 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 t o 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 e ven steps, and can be very useful, for example, when trying to move something ex actly 250 frames. So now that you've duplicated the location keys from the first frame and moved t hem to frame 250, your animation starts and begins in the same place, meaning th at 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, usi ng the Tab key, RMB for selection, Shift-D for duplication and G-key and S-key f or 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 base d on a tourist attraction that includes a parking lot with cars, grass, a monume nt and models of people. When working on the monument portion of the scene, havi ng 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 it s own layer, it becomes possible to easily hide or show any set of objects as yo u 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, movi ng 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 e xact same animation curves as the original object. In fact, both the original an d the duplicate object are linked to the same Ipo curves, meaning that if you we re 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 timeli ne. Obviously, you don't want that to happen. To remove the link between your newly duplicated object and the old animation cu rve 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 do es in the illustration, try MMB dragging the header to the left to show addition al header items.) This drop down menu contains all of the sets of animation curv es 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 o f twenty boxes and a large Okay button appear. Press the number 2 on your main k eyboard (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. S hift-D to duplicate the Empty and RMB again to cancel any movement of the duplic ate. At this point our duplicate Empty is selected, but resting in exactly the s ame 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 electr on 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 seve ral layers at once. You can set Blender to display any combination of layers tha t you need to see. In your current scene, the nucleus and first electron exist b y 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. Immediate ly, 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 wor ld, 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 Lay er 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 1key, then the 2-key. It has exactly the same effect as clicking on the buttons i n 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 t he point where layer assignment and selection is second nature - your fingers wi ll 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 object s to other layers. Now that we've covered the basics of working with layers, let's look at a differ ent method of making your new electron circle around the nucleus. This way build

s 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 dup licate 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 o n the "X" next to the Ipo name. Now, make sure that you are on Frame for the Empty. Pick a frame further the Empty along several axes, making riginal. Place another rotation key. in the timeline or Alt-A) to see the 1. Use I-key and set a "Rot" (Rotation) key on in the animation, say, 50 or so. Rotate it a fairly significant rotation from the o If you like, play back the animation (Play 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 repre senting the Empty's rotations along different axes. Use the A-key to make sure a ll the curves are selected (selected curves have white key points; unselected ha ve 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 "Extr apolation". 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 Fr ame 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 E mpty. 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 sam e parent-child relationship as the originals. When you duplicate the objects, mo ve 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 distan ce. 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 E mpty. 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 ke yboard combination "Ctrl-Alt-C", and a menu titled "Add Constraint to Active Obj ect" will pop up. From this menu, choose "Track To". Instantly, the empty rotates so that it points toward the original electron, mov

ing its child with it. Figure 1.26.1: [no text] What you've just done is added something called a "constraint" to the Empty. Con straints are mostly used in Blender to limit or change locations, sizes and rota tions of objects. In the case of the "Track To" constraint you just added, the c onstraint 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 bee n added to the Constraints panel. Figure 1.27: The Constraints panel in the Object buttons. You could have used ng you've just done object name in the selections and the y. the "Add Constraint" button in this panel to do the same thi in the 3D view, but you would have had to fill in the proper panel's "OB:" field to get things to link up properly. Using Ctrl-Alt-C hotkey builds the constraint for you automaticall

Callout: Ctrl-Alt-C brings up the Constraint menu, which adds a constraint to th e 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 pr actice your precision movement, you can always use the Shift-S snap method descr ibed 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 th e 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 disp lay. 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 th at you've used before to rotate your view. It works while the animation plays ba ck! The other view translation controls work as well, although you'll have to us e 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 practi ce, add some objects to the nucleus and toss in some more electrons until you ha ve the element of your choice. Rendering for Animation In the Interface chapter, you rendered a still of the default cube which was, wi thout 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, d rawn in whatever style (solid/wireframe) and from whatever perspective the 3D wi ndow 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 head er. 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 waiti ng 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 y our animation to make sure that everything is moving correctly, but not nearly s uitable 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, wi th the mouse still over the 3D view, press Numpad-0 to switch to the view from t he camera. Figure 1.30: The camera's view of the atom. The outer solid border in this view represents the camera object itself and shou ld 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 t he 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 th e Scene buttons (F10). Blender will begin to actually render your scene, frame b y frame. Even on a speedy computer, this will take several minutes, so go get yo urself a drink. When it's done, press the play button again to see the finished, rendered animat ion. It doesn't look so hot, does it? Even rendered. Don't despair - you haven't lear ned modeling yet, or materials. Or lighting for that matter. But you know the ba sics of working with Blender objects and animation now, so the rest will come ea sily. BLENDER OPEN CONTENT LICENSE Terms and Conditions for Copying, Distributing, and Modifying Items other than copying, distributing, and modifying the Content with which t

his license was distributed (such as using, etc.) are outside the scope of this license. 1. You may copy and distribute exact replicas of the OpenContent (OC) as you re ceive it, in any medium, provided that you conspicuously and appropriately publ ish on each copy an appropriate copyright notice and disclaimer of warranty; ke ep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the OC a copy of this License along w ith the OC. You may at your option charge a fee for the media and/or handling i nvolved in creating a unique copy of the OC for use offline, you may at your op tion offer instructional support for the OC in exchange for a fee, or you may at your option offer warranty in exchange for a fee. You may not charge a fee for the OC itself. You may not charge a fee for the sole service of providing acces s to and/or use of the OC via a network (e.g. the Internet), whether it be via the world wide web, FTP, or any other method. 2. You may modify your copy or copies of the OpenContent or any portion of it, thus forming works based on the Content, and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of the se conditions: a) You must cause the modified content to carry prominent notices stating that you changed it, the exact nature and content of the changes, and the date of an y change. b) You must cause any work that you distribute or publish, that in whole or i n part contains or is derived from the OC or any part thereof, to be licensed a s a whole at no charge to all third parties under the terms of this License, unl ess otherwise permitted under applicable Fair Use law. c) The name of the Copyright Holder or contributors to the OC may not be used to endorse or promote products derived from this software without specific prior written permission. These requirements apply to the modified work as a whole. If identifiable sect ions of that work are not derived from the OC, and can be reasonably considered independent and separate works in themselves, then this License, and its terms , do not apply to those sections when you distribute them as separate works. Bu t when you distribute the same sections as part of a whole which is a work base d on the OC, the distribution of the whole must be on the terms of this License , whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Exceptions are made to this re quirement to release modified works free of charge under this license only in c ompliance with Fair Use law where applicable. 3. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to copy, distribute or modify the O C. These actions are prohibited by law if you do not accept this License. There fore, by distributing or translating the OC, or by deriving works herefrom, you indicate your acceptance of this License to do so, and all its terms and condi tions for copying, distributing or translating the OC. NO WARRANTY 4. BECAUSE THE OPENCONTENT (OC) IS LICENSED FREE OF CHARGE, THERE IS NO WARRANT Y FOR THE OC, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE S TATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE OC "AS I S" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU LAR PURPOSE. THE ENTIRE RISK OF USE OF THE OC IS WITH YOU. SHOULD THE OC PROVE F

AULTY, INACCURATE, OR OTHERWISE UNACCEPTABLE YOU ASSUME THE COST OF ALL NECESSA RY REPAIR OR CORRECTION. 5. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MIRROR AND/OR REDISTRIBUTE THE OC AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPEC IAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE OC, EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILI TY OF SUCH DAMAGES.

Potrebbero piacerti anche