|
Tutorial: How to properly export a 3D Collada model from Blender to use in Papervision3D |
|
Papervision3D is a 3D engine for Flash. Blender is a 3D studio. Collada is a 3D file format. All of these are open-source and the documentation is done by volunteers, which means it can be a real nuisance trying to figure out how to do the simplest task. So I've thrown my hat in the ring and prepared this tutorial to show how to get your Collada models into a state that Papervision3D can use. UPDATE: If you want to learn how to apply different materials and manipulate objects, go to my other tutorial.
If you want a textured material for your model, you need to create an image that gets mapped onto the surface of your model. I hate tutorials with unnecessary words, so let's get going on how to do this. Keep in mind that you'll likely want to experiment with different options after you've found out "what works".
- This tutorial uses Blender 2.4.4 (updated for version 2.4.6+, see parentheses). This is a good version to have if you ever want to use the "Bake Textures" feature (not covered here). If you use a different version, the features I am describing may not be found in the same menus or panels (like the Collada export plugin ). You've been warned!
- Create new file (click File>New).
- Make your model. For this tutorial you might want to use the basic cube that appears by default.
- Go into UV face select mode. (version 2.4.6+ users just select Edit Mode – your menu is different)

- Click Face>unwrap UVs (version 2.4.6+ users click the Mesh menu and select "UV Unwrap")

- Click Unwrap(smart projections) and then click OK (using the defaults). (version 2.4.6+ users should be okay from here on)

-
Now you can see an unwrapped map of the surface in the UV/Image Editor. To do this, click the Window Type icon and then select UV/Image Editor:

- Click UVs>Scripts>Save UV Face Layout.
This saves a Targa (tga) file that you can edit in Photoshop (or another image editor). Make sure to save the file as .png or .jpg (the formats that Flash & Papervision3D understand) from Photoshop.
- In Blender again, select Image>Open and select the file you modified in Photoshop. It's probably a good idea to activate the "Relative Paths" button before you click the Open Image button (just to get in the habit) but for some reason the resulting Collada file still uses absolute paths. We'll fix
this later.
- Go back to 3D View via the popup menu (see step 7 above).
- Choose "Textured" from the Draw Type popup.

The texture should now appear on the model. It won't render yet though... hit f12 to see.
- In the buttons window, click the Shading button or hit f5. Then click the Material button.

- If all you see is a "Links and Pipeline" menu, click the "Add New" button. Under the Material tab that now shows, select the TexFace button. Now if you do a test render (f12) you can see the UV map now.
- Click File>Export>COLLADA 1.4. Select "Triangles", "Use Relative Paths" and "Use UV Image" (latest version of plugin says 'Use UV Image Mats'). Make note of the file path. Then click "Export" or "Export and Close".

- That's it! Now you can import the model as a Papervision3D Collada object! If you happen to have trouble with the file you might want to check it in a text editor to see whether the paths to your texture file are actually relative paths (no references to your local hard drive).
|