Help Displaying Textured FBX Models

I have a textured static model in Blender 2.77 that I wish to display with MonoGame. I thought I’d export it from Blender as FBX. Because I’m relatively new to MG, I started with an MSDN tutorial, Tutorial 1: Displaying a 3D Model on the Screen. Unfortunately the FBX format of the included model is deprecated by MG’s importer. Nevertheless, I reverted to a simple Blender model – a cube with each face mapped to an image. (I’m developed several complex models in Blender, so I know how to UV map faces of a cube.)

For guidance, I used the pipeline tool Help documentation – step by step. I have to admit to being a bit mystified because the documentation does not put the tool in perspective. Is it meant to be used (for content) independently of Visual Studio or together? If together, in what order? The documentation does not discuss textured models, so I had to resort to other sources – an ebook and the web. From these sources, I gather that, after an XNB is built, it has a relative reference to the path of the texture image file, and the image file should not be built as content, but copied separately to the output folder. QUESTION: Is that interpretation correct?

Result: The model displayed, but it was not textured. I double-checked that I had copied my image file into a folder named Textures. I verified that my FBX file had UVs by importing it to a vacant scene in Blender and selecting all faces. I looked at the FBX file with Notepad, seeking to verify that it had references to the image file. Unfortunately, with a binary file, I couldn’t be sure. Instead, I exported an ASCII FBX from Blender, and it did have several references.

If I can get some step-by-step advice for how to address the content build and distribution, I will start with a fresh new VS project.

By the way, I saw the recommendation to assure a build action of MonoGameContentReference. I did not see that option; I saw only Build and Copy.

MonoGame Version 3.5.1.1679
OS: Windows 10 (64-bit)
IDE: Visual Studio Community 2015 Update 3
MonoGame Project Type: WindowsDX

Walt

FBX files can be finicky. I usually try to export in ASCII (one of the exporter options) because quite often I’ve had to hand-edit bits in the FBX file to fix them. One of these is paths to textures that were referenced by the FBX file. I’ve seen them as absolute paths, and I’ve also had to fix paths because the artists used textures that were in a completely different location to the exported FBX and then gave me the FBX and textures in the same folder.

The MonoGameContentReference Build Action is provided by one of the .targets files we have as standard in the supplied project templates. Create a new MonoGame project from one of the templates, then use Notepad to have a look in the .csproj file for the .targets that we provide. Make sure these are in your .csproj as well.

I exported an ASCII FBX from Blender and restarted a new VS project, just plain ole Windows (the one at the top). When it built, there were no compiler errors reported, but there was no XNB built anywhere. I tried to build content with the pipeline tool, and it failed. The ASCII Blender export is down-level (Blender 2.77 says regarding compatibility: FBX 7.4 binary, FBX 6.1 ASCII):

Still just Build and Copy available in the pipeline tool. I looked in my .csproj file, and, at the bottom, there is one Import tag that is MonoGame related. It is followed by a comment with instructions. The problem here is that I don’t know what it means by a “task.” Remember, I’m a real newb.

You might try using FBX Converter UI from Autodesk (free) to upgrade the FBX to a later version.

It took me a while, but I got it. Two things were crucial; (1) the FBX converter, which was essential, and realizing that FBX’s relative path is relative to the model, not the parent directory of Models and Textures.

Both the outputs of the Blender FBX exporter and the Autodesk FBX Converter require hand-editing of the FBX files. I edited the Blender output then updated the FBX version to 2013, only to discover that the FBX file converter, with a mind of its own, converted the “Relative Filename” to an absolute path. When I do it next, I’ll try exporting in binary (which will get me more up to date) and then use the FBX converter to produce an ASCII output.

Initially, I used Textures\ as the relative path to my file. That did not work. I changed the path to …\Textures\ and became a happy man.

I accidently (I was thrashing) ended up building an XNB for my texture. But, no matter, I’ll try it the other way later.

When I’ve my head sorted out on all this, I’ll document my newfound knowledge here.

@kennethsuda and @Walt_Niehoff

I suggest you download FBX SDK 2017 and compile into exe ( import / export sample application

You can use example app import / export example you export 3ds or dae with embedded texture. than you open import export from FBX SDK 2017 than you can try Monogame again.

PS: Sorry for old thread - I don’t like disturb about old thread…

Thanks for explanation with FBX SDK 2017 and try with MonoGame