====== Blender Model Export and UV Texturing (Blender 2.6+) ====== Here are the steps required for exporting a textured object from [[http://www.blender3d.org|Blender3D]] to Unity 3D. ===== Configuring Blender ===== - Take a look at the user preferences under **File->User Preferences...**. - Under the **Input** panel, notice that you can make is so that you **Select With** your left mouse button. **By default you select with the right mouse button**, which is quite unintuitive, so consider changing this. - Also, under this panel, you may want to choose **Turntable** as your **Orbit Style**, since that makes the 3D window work like a potter's wheel, keeping your objects steady on the horizontal plane as you rotate them. - When you are happy with how you have configured the Blender environment, use **File->Save User Settings** to make that configuration into the default configuration for Blender. ===== Applying a Texture to an Object ===== - Select the cube (Left mouse button if you have changed the configuration, Right otherwise) - Name the selected object "Box" (press "n" for the "name" panel and type in "Box" under **Item**) - Now is a good time to save your Blender file, give it a name like "box.blend" and keep all your files for this model in the same folder (to see these files in Unity, keep them all somewhere under "Assets", e.g. "Assets/VIEN/Props") - Switch to **Edit Mode** (The mode selector currently shows "Object Mode") - Switch to **Edge Select Mode** (Three buttons on the bottom bar of the window: vertex, edges and polys) - Multi-select (hold SHIFT) the "seam" Edges of the Box (for a fold-out cube) - **Mesh->Edges->Mark Seam** - Split main window (Drag the upper right corner of the 3D window to the left, revealing a second copy of the 3D window) - Select the **UV/Image Editor** view for new window from the view selector in the lower left corner of window - Select your object again in the 3D view (press "a" twice to select the whole object) - 3D Window: **Mesh->UV Unwrap->Unwrap** (you should now see the fold-out texture from the cube appear in the right UV/Image window) - UV Window: **UVs->Export UV Layout..** * And now you have a texture which you can edit in your favourite paint program (like [[http://www.gimp.org/|GIMP]], which is free!). Once you're done painting it, you can import it back into Blender like this: - UV Window: **Image->Open Image** (pick your file here and it is applied to your object) - To see it in the 3D Window, choose **Draw Type: Textured** from the **Draw Type** pop-up menu next to "Edit Mode" ===== Exporting the Textured Box ===== - Go into **Object Mode** and make sure your object is selected - Choose **File->Export->Autodesk FBX (.fbx)** - In the panel on the left, make sure to select **Simple** for the **Tex. process** and also check the **UV as Texture**. If you are keeping everything in the same folder, also uncheck the **Copy texture files** check box * If your files are all under "Assets" in Unity, you should now be able to find your exported FBX object in Unity's "Project" panel * **NOTE** Before you drag your object into your Scene, select the object in the "Projects" panel and change the ''Scale Factor'' to ''1.0'' in the ''Meshes'' component.