Not with the type of OBJ the Blender exports - if you open the .obj file in Notepad you’ll see it only contains data for vertices and UVs, but no texture references. So you would have to manually process, load and assign your textures.
Might be your OBJ files, that get exported by whichever program you’re using, are different. Take a look with notepad if they contain texture references.
Blender’s default export format Collada (.dae) also works, but make sure to set the Importer to “Fbx Importer - Monogame” in the content pipeline tool. [See for details: https://github.com/MonoGame/MonoGame/issues/6179 ]
With the added benefit of:
Did Blender not created the .MTL file for materials along with. OJB exported files ? that sad T_T But good to know Collada is supported in content pipeline out of the box.
It would be better if you make screenshot all blender window because panels on 2 and 3 pictures are different with panels in my blender 2.8 and blender 2.76.
Blender 2.80 will not work, since it uses nodes for material textures and does not export that information into the exported files (tested .fbx, .dae, .obj). That’s why i stated at the top that this is for blender 2.79 (and below).
Also i’m not sure how seeing the rest of the window would help you, since the rest is only the preview viewport and the timeline.
I managed to get Blender 2.80 models into Content Pipeline. Only difference was that I had to export texture painted onto the model (in Texture workspace) separately from the model itself. Did that with 3 models so far, after some fumbling with the export settings there was no problem (albeit I had transparency issues).
The latter. Except for me having problem figuring out the correct path settings during export, my workflow haven’t changed between 2.79 and 2.8. So the workflow is basically
Export model from Blender (to .fbx or similar)
1a. Export the texture
Add exported model to pipeline
Copy texture to Content folder (without loading it in pipeline)
Load model in game
Set effect.TextureEnabled = true when setting mesh parts’ BasicEffect settings
It’s how I did it before, and it worked on a first try. Well, first time after Content Pipeline built it, because as I said, I didn’t know (and still don’t really know) which path settings are correct during export to .fbx X)
That and the transparency issue, but I didn’t know until reading this thread assimp has a bug so that I need to manually set effect.Alpha = 1.0f
I’ve watch video on YouTube and then I do model with texture. Also I want say that Blender 2.79 can work with nodes. And using nodes is easier for me because I need to cover sphere by texture and Blender generates a difficult and uncomfortable uv view for sphere.
And exporting does not produce any reference to the texture, only material colors.
(Readable ones i check in notepad, binary like fbx i use debugger to see there’s no texture set to the mesh)
Example of .dae result: https://pastebin.com/A6xnkSJw
Thank you for the video, I followed your instructions and it worked (note about quality: the text on some of the controls is blurry so sometimes it’s hard to see)
Afterward I found out the problem with my textures - I needed to include the Principled BSDF shader node, than the model got exported correctly with texture reference.
Everyone in this thread is awesome. I spent a few hours tonight banging my head against this (after following the instructions from a 4-year-old GamesFromScratch video) and the solution was sitting in here all along.
I have rigged animated models loading from blender 2.79b thru assimp.net nuget directly into monogame. I still need to work out minor bugs and redo the model class i made im not sure how ill deal with textures either yet but its damn cool.
(i say minor bugs because most of the models i tested pretty much work even in the rough state this is in now. I have this running in a single project primarily just two classes so far the reader and the model. The only dependency is downloading the nuget assimp.net package.)
Will post up a example project soon as i get something presentable.
The texture references in the FBX file look to just be “grass.png” as I’m stripping away the path, but the MGCB seems to be taking the “assets\models\temp” part of the path and using it when building the grass texture, which is referenced in the TestWorld FBX. Is there a way to just have MGCB keep the model and texture together throughout the build and copy process?
For reference, the snippet where I’m including the FBX file in Content.mgcb:
I got disillusioned trying to load models thru monogame and wrote my own loader and model classes using the nuget open assimp importer directly which can load blender 2.79 generated fbx files directly.
I purposely separately loaded the textures though then attach them to the model when i load the fbx.
I was getting that renaming on the xnb’s as well when i tried to do it thru monogame and other problems also like missing data that i needed.