Question

I have a problem with importing fbx models into my monogame project on linux.

If i try to load the fbx file with

model = Content.Load<Model>("cone.fbx");

i am getting the following Error:

Microsoft.Xna.Framework.Content.ContentLoadException: Could not load cone.fbx asset!
at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[Model](System.StringassetName, System.Action`1 recordDisposableObject) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.Content.ContentManager.Load[Model] (System.String assetName) [0x00000] in <filename unknown>:0

Ok, now people said that the current version of Monogame is not able to handle fbx files but .xnb ones i could create with XNA 4.0 on my windows operating system. That said and converted the file at windows to xnb (the fbx file "loads" fine on windows, so does the xnb one) -> still doesnt work on Monogame.

Could not find matching content reader of type Microsoft.Xna.Framework.Content.ModelReader, Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553 (Microsoft.Xna.Framework.Content.ModelReader, MonoGame.Framework.Linux, Version=2.5.1.0, Culture=neutral, PublicKeyToken=null)

But I dont know how I can transform my .fbx file to a xnb file which really works (do I need another content reader or something? /how?)

Was it helpful?

Solution

  • use a standard xna project to generate the xnb file from the .fbx ,
  • import the generated xnb inside your monogame project ,and don't forget to specify the build action (right click on the xnb file -> choose property ->In Build action select 'content')
  • finally You don't need to specify the file format in the load method , model = Content.Load("cone");

another way to generate the xnb file using a windows phone 7 project is described in this post http://www.billreiss.com/monogame-for-windows-8-step-2-content/

..that should work

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top