Hi,
This is my workflow.
Hope this helps...
Exporting a Textured Model in the FBX Format from Blender to XNA
Comprehensive Workflow (using Blender version 2.44)
FIRST CREATE A SIMPLE TEXTURED CUBE MESH ...
1. Launch Blender and start a new empty scene
2. Create a cube: <hit space bar in top view> then Add->Mesh->Cube
3. Select 'Object Mode'
4. Hit the 'N' key to bring up Transform Properties and Scale X,Y,Z by a factor of 8 - then close the dialogue
5. Select the Shading tab (hit F5) and Add New Material to the cube
6. In the Materials Panel, select 'TexFace'
7. In the Texture Panel, select 'Add New'
8. In the 'Map Input' panel, select 'UV'
9. Change to 'UV Face Select' mode
10. Make sure all the faces of the cube are selected
11. In another viewport, open up the UV Image Editor
12. Select Image->Open and open a texture file - the texture should now be visible in 'UV Face Select' mode viewport
13. Return to Object Mode and turn on the 'Textured' Draw Type - you should now see a textured cube in Object Mode
14. Save the .blend file here
NOW WE CAN EXPORT THE FBX FILE ...
15. With the cube selected, choose File->Export->Autodesk FBX (.fbx)
16. Change the output directory to your Desktop and call the file something like 'textured_cube.fbx'
17. Hit the 'Export FBX' button
18. Close Blender (or minimise)
19. Using Windows Explorer, copy the texture file to the Desktop also
20. Navigate to your XNA Project and place the model file in the directory: Content \ Models
21. Place the texture file in the directory: Content \ Textures
STARTING-UP XNA GAME STUDIO ...
22. Launch Microsoft Game Studio Express
23. Open your model viewing project
24. In the 'Solution Explorer', right-click on 'Models' directory and select Add->Existing Item
25. Change the 'Files of type' to 'Content Pipeline Files' and then navigate to the Content \ Models directory
26. Select the model file you just created in Blender: 'textured_cube.fbx' and click-on the Add button
27. In the 'Solution Explorer', right-click on 'Textures' directory and select Add->Existing Item
28. Add the texture file to your project
NOW WE NEED SOME CODE ...
29. Edit the code as shown below:
Model myModel;
protected override void LoadGraphicsContent(bool loadAllContent)
{
if (loadAllContent)
{
myModel = content.Load<Model>("Content\\Models\\textured_cube.fbx");
}
}
30. If you try and build at this point you will get an error message like this:
"Missing asset "C:\Users\user\Documents\Visual Studio 2005\Projects\ModelViewer\Content\Models\fbx"
This occurs because the Blender FBX Exporter doesn't know about the directory structure of your Model Viewer.
It adds a folder called fbx, which you definitely don't want.
To solve this, we have to edit the FBX Model file and change the Relative Path to our texture file.
FINALLY, WE HAVE TO EDIT THE FBX (ASCII) FILE
31. To open the code for the FBX model, left-click twice on the file in Solution Explorer. If you've followed the above steps it's called 'textured_cube.fbx' .
32. With the model file open, select Edit->Find and Replace->Quick Find (or use CTRL + F)
33. In the 'Find what:' field enter the following: 'RelativeFilename'
34. Change the path to your texture. The code should look something like this:
RelativeFilename: "..\textures\myTexture.jpg"
Notice the use of the two dots at the start of the path. These are important because the compiler has to navigate up one level to find the Textures directory.
35. Repeat steps 33 and 34 until all the RelativeFilename references are corrected.
36. Click-on the 'Save All' toolbar button and build the project
YOU SHOULD NOW SEE THE TEXTURED CUBE WITH ALL OF THE UV COORDS PRESERVED
Note: The new Blender version 2.45 has an updated FBX exporter