Flash_and_Flex_03_2009

Blender to Flash workflow

Creating a Texture I won’t be going into the details about modeling in Blender. There are a few very good books on this topic (see the Where to go from here section). We will create a texture for the cube that exists in the default 3D scene. To get started we need to activate the Shading Context and its Sub context, Texture Buttons, see (Figure 6). The Viewport Shading type should be set to Shaded, see (Figure 3) to see the Texture we are going to apply to the model. Now we’re all set to pick a texture and see some results. Select the Marble texture from the Texture type drop down, see (Figure 7) in the Texture buttons panel and see the object in the 3D window change. You can see that the texture is not as detailed as the preview in the Texture buttons panel. Rendering textures is a very costly operation so it is generally not a good idea to render every time the texture is changed. To see how our texture looks on the cube, press F12. This triggers a render of the current frame, see (Figure 8). You can see that the colors are a bit odd and don’t match the texture preview. The render shows magenta

The leftmost button allows us to change the window type. You can see that this menu appears in all the windows. This basically means that you can have any type of window anywhere you want. You can for instance create as many 3D views as necessary. To illustrate this, let’s create a second 3D view. The current 3D view window can be split in two parts by right-clicking on the border line between the 3D window and the window underneath it. When hovering over this border the mouse cursor will change to a double arrow. When you right-click a context menu will appear, see (Figure 4). Choose split area from this menu and a grey line will appear. Make sure you stay above the border and left- click anywhere on the 3D view. This creates a second 3D window. We actually don’t need a second 3D window but we will need the Image Editor later on. The view can be changed by clicking on the window type selection menu. This is the leftmost drop down menu, see (Figure 5). Click on the menu and select UV/Image Editor . The window below the 3D window is called the Buttons Window. This window contains panels that configure objects, sets options and properties for materials, sets rendering options and more. Later on we will use the Shading panel and the Scene panel.

and white instead of black and white. We can change this color by going into the Material buttons panel, see (Figure 8) and then to the rightmost tab called Map To, see (Figure 9). You can see the Magenta color that we need to change. Click on the magenta square, pick a new color (for instance #990000) and press [ F12 ] to render the current frame. You’ll see the red color showing up in the generated image. Now that we have created our object and its texture we’re ready export some files. Exporting the texture Before we can use this texture with any 3D Enginewehavetocreateanewimagefirst.When we have done that we need to unwrap the UV coordinates. These coordinates tell the engine were to put the different parts of the image. Let’s create a new image for our texture. Go to the UV/Image editor window, see (Figure 7) and then select New… from the Image menu, see (Figure 10). In the dialog that opens enter 1024 as the width value, 768 as the height value and then press OK. Nowwe need to unwrap the UV coordinates. Go the 3D window and change the mode to Edit Mode , see (Figure 4). To the left of the Modes menu there is a menu called Mesh . Click on this menu and choose UVUnwrap , see (Figure 11). This opens up the UV Calculation menu. From this menu, pick the last item called Unwrap (smart projections) . A new dialog opens where you can specify details about the Projection and the UV Layout. Because we’re unwrapping a simple primitive the default values will do the job. Click the OK button

Figure 4. Splitting the view

Figure 1. The Blender user interface

Figure 6. The Shading Context and Texture Button Context

Figure 2. Mode menu

Figure 3. Viewport Shading menu

Figure 7. Choosing a texture type

Figure 5. View type selection menu

03/2009 (5)

85

Made with FlippingBook HTML5