Posted 05/05/2014 12:20:54 in Blendering for Unity
Updated 08/20/2017 17:47:14
Open up Blender. If it's your first time using it (or you haven't changed the defaults), a scene will open with a cube, a light, and a camera. These are all a part of a default startup file that loads when Blender opens or when you hit File->New. If you were to jump right in and make that cube into a model and load it into Unity, the camera and light will be imported also, creating a messy file and more work for you since you'll have to delete them in every model that you import. So let's create a better startup file, and learn a bit about Blender controls along the way!
The first thing you'll want to do is to configure the preferences to make Blender behave a little bit better for what we're doing. Open up the user preferences menu (File->User Preferences...) and make the following changes:
Check "Zoom to Mouse". This will make zooming with the mouse wheel more intuitive.Check "Rotate Around Selection". This will make rotating the view with the middle mouse button more intuitive.Uncheck "Cursor Depth". This will make placing the 3D cursor easier for our purposes.Uncheck "Auto Perspective". This will keep the orthographic view active when we rotate around our model.
Note: If Blender crashes when you open up the menu, it's a bug in Blender dealing with Intel graphics and a workaround is to change the 3D view to the preferences menu temporarily. This post describes how.
Make sure you click "Save User Settings" on the bottom left of the preferences popup, then X out of the popup.
Next, play around with the viewport a bit to get a feel for the basic controls in Blender.
- Numpad 1: Takes you to the front view.
- Control + Numpad 1: Back view.
- Numpad 3: Takes you to the right view.
- __Control __+ Numpad 3: Left view.
- Numpad 7: Take you to the top view.
- __Control __+ Numpad 7: Bottom view.
- Numpad 5: Toggles between orthographic and perspective views.
- Numpad 2, 4, 6, and 8: Rotates the view 15 degrees down, left, right, and up respectively.
- Mouse Wheel: Zooms in and out on the mouse pointer position.
- Middle Click: Rotates around the currently selected object(s).
- Shift + Middle Click: Pans the view along the viewport plane.
- T: Toggles the tools panel on the left side of the 3D viewport.
- N: Toggles the numbers panel on the right side of the 3D viewport.
- Right Click: Selects objects, vertices, edges, and faces.
- Shift + Right Click: Adds to or subtracts from the selected objects.
- __X __(or Delete): Deletes objects.
Once you have the hang of it, I'd recommend switching the view to orthographic mode with __Numpad 5 __and leaving it in ortho mode for the rest of this series. It makes it a lot easier to accurately do what you want to do!
Once you have a feel for how to move the view around, go ahead and delete the camera and light objects in the scene. Right Click to select the light, and press X or Delete to bring up a confirmation context menu. Click on "Delete" to remove it, and do the same for the camera. I want to make a quick note here that a lot of the keyboard shortcuts in blender are applied to the frame that the mouse pointer is currently in, so make sure that the cursor is in the viewport area.
When you're working in Blender, you switch between different "modes" to accomplish different things. So far we've been working in Object Mode. This mode is for editing things that have to do with the entire object (such as applying modifiers, which we'll get to later). We want to actually edit the model itself, so we'll use Edit Mode. Note: Make sure that the cube is selected and has the orange border around it! You won't be able to enter Edit mode without a selection, since Blender won't automatically know which object you want to edit. At the bottom of the viewport, click on Object Mode to bring up a list of the modes currently available and select Edit Mode. You can also just hit Tab to switch back and forth.
You'll notice that the vertices and edges on the cube are now visible. They are also orange, which means they're selected. What we want to do now is move the cube upwards, so that our model doesn't appear halfway underground in Unity.
N toggles the number panel, so hit it to open it up on the right side. Look for "Z Median Transform" towards the top of the number panel, and type in 1 and hit enter to raise all the vertices by one unit. We're finished here for the moment, so press Tab to go back to Object Mode.
I'm going to take a quick aside here to talk about some considerations involving the way Unity imports Blender files:
This default cube is 2 units tall in both Blender and Unity, so it can serve as a great reference for making sure that there aren't any scaling distortions on import. Blender uses a Z-up coordinate system, whereas Unity uses a Y-up system. There isn't a way to change this in Blender, but Unity will automatically rotate your models correctly when you import the .blend file.The little orange dot that's visible in Object Mode is the origin of your model. In Unity, rotating, positioning, and scaling the model will happen relative to this point. I find it useful to keep this at the character's feet, but I'll go in to how to move the origin later on in these tutorials. __If you need to scale, rotate, or move the entire model, do it within Edit Mode, not Object Mode! Unity has problems when importing models with full object transformations, so you'll want to go into Edit Mode, select all with A, and then apply the transformations. If you do move the model in Object Mode, you can apply the transformations by hitting __Ctrl-A __and selecting the type of transformation you want to apply (you may need to do it twice; once for "Transform" and again for "Rotation and Scale").
We're just about done with our startup file, so I'll make a few more notes about how the Blender UI works. The UI is made up of several totally customizable frames; right now, you should have the following frames open:
- Info Frame: This functions as the taskbar.
- 3D Viewport: This displays the current scene, and you'll be doing most of your editing in here.
- Timeline: This is used for animation.
- Properties: This displays the properties of the active object and related "datablocks" (materials, textures, bones, etc.).
- Outliner: This displays all of the objects and datablocks in the scene graph.
Each frame has a little triangular icon in the bottom-left and top-right of its area. Dragging these will allow you to add or remove frames to customize your UI. Also, when you hover over the border of two frames, your cursor will change to a two-headed arrow, which lets you click and drag to resize the frames. For now, we just want to remove the Timeline frame since we won't be animating for a while. Click on the triangular icon in the bottom left of the 3D View frame and drag down over the Timeline frame to remove it.
We're all set up for some modeling! Click File->Save Startup File and confirm (this saves the UI and User Preferences as well as the cube scene) and we're good to go!