Hi,everyone!
I am a newer to MonoGame and I appreciate the effort that MonoGameTeam did.
I am using version 3.7.1 MGCB to generate .xnb file(.png/.jpg/.fbx/.obj as source file to .xnb).
But when I delete these source file and just keep .xnb file,errors âThe source file âfilepath/.objâ does not exist!â show in VS2017.
When I use 3.5.1,there is no these problems.I just need to keep .xnb,and it could compatible with all platform.
How can I deal with this?
Appreciated!
Depending on your setup, the pipeline will get started every time you compile your game in VS. So it tries to detect changes and just re-compiles the changed assets, but it sees your asset is gone. Hence the error.
Thanks for replying.
But how can I deal with it?
And there is another question, the MGCB can not compile my obj file to xnb,but in 3.5.1,there is no such problem.
Hi @ZhenNewBee Ni Hao Ma?
Welcome to the forums!
Have you tried converting the OBJ to say a .X and running it through MGCB?
Happy Coding!
EDIT
Oh and forgot to mention, the parser thing was changed around 3.6.
We just donât delete the original asset-files.
Think of them as the source files for graphics/audio/video. They get âcompiledâ when you compile your project and the pipeline tool will see to it that it doesnât compile unnecessarily.
You wouldnât delete your main.cs file after compiling either.
But when youâd like to do the MGCB-stuff manually, just set the build-action of your MGCB-entry in the content folder to ânoneâ.
Example:
Here I have two pipelines in a single project. The first one, called âContent.mgcbâ runs automatically on build.
The second one doesnât, so I have to trigger it manually (or copy the xnb files to the output folder, or whatever. Depends on your MGCB project settings for output-folder).
Properties of âContent.mgcbâ:
Properties of âContentAudio_Manual_3.5.1.mgcbâ:
Thanks for replying.
Iâve tried not only .x file,but also almost every model format.
It seems that only .fbx format works fine.
Whatâs more,all of the texture will be blank when I tranform .obj to .x.
Could you please offer me a link to let me know the changes of MGCB between 3.5.1 and 3.6?
Keep the texture in the same folder, double check the texture reference inside the file using a text editor.
Take a look here, unsure if it is current though:
http://www.monogame.net/documentation/?page=Using_The_Pipeline_Tool
This is the current 3.7.1 Change Log with history:
I think it is called OpenAssetImporter or AssImp
Thanks for your patient answer.
It still did not work.
Could you post a screenshot of your âcontentâ folder like I did above?
It should be empty except for a single MGCB file.
And that file should have that property set, like in my screenshot (buildaction = none).
Then the pipeline does nothing.
So the error should come from the game-runtime itself, trying to find an object-file and not finding it.
The error âThe source file âfilepath/.objâ does not exist!â indicates that it searches a file without a name ?!
Howâs that? Are you trying to load an empty name-string somewhere in your code?
Thanks for your warm-hearted answer.
@MrValentine @throbax
I have solved it by myself.
And I find 3 bugs in MGCBâŚ
1.You need to use the âfbx importerâ type if you want to import obj or you will get plenty of errors.
2.You need to remove the occupation of MGCB if you want to delete the source file and keep xnb file only.
3.You need to get your xnb file backed up when you want to rebuild model.For example,you got 2 modelâââboyâ and âgirlâ.You got the âboy.xnbâ and just want to rebuild âgirl.xnbâ.But you have released the occupation of âboyâ model.You will find all of your xnb file get deleted except âgirl.xnbâ if you click ârebuildâ button.
@Tom @Jjagg
Thanks for the hard work of MonoGameTeam and I wish these bugs could be fixed.
It will be great if MGCB supports Blender.
This is actually why I would have preferred the MGCB to be a standalone thing, completely removed from the templates, which is why if you follow my tutorial on it, I isolate the MGCB from my projects entirely.
Verbosity warning in advance you have been informed
And thanks for updating us here, I for some reason did not get a notification and the thread was not marked for me with your response, saw the notification in my junk folder in emails⌠anywayâŚ
Code On!
Oh and yes, BLENDER totally!
Haha.
Actually I have read your tutorials before I raised up this question,and that is very friendly to a newer like me.
Thanks for your contribution.
Still,there are many painstaking work need to be done.