Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load FBX #48

Closed
ghost opened this issue Aug 2, 2016 · 8 comments
Closed

Unable to load FBX #48

ghost opened this issue Aug 2, 2016 · 8 comments

Comments

@ghost
Copy link

ghost commented Aug 2, 2016

Hello

I tried to load a simple FBX but it can't find the file? I get a ('System.IO.FileNotFoundException')

Is this a bug or i'm missing something?

            mModel = Content.Load<Model>("Ship");

Here is the FBX i used: http://rbwhitaker.wikidot.com/local--files/model-library/SimpleShip.zip

@ghost
Copy link
Author

ghost commented Aug 2, 2016

And if i add the extension .fbx i get the following error:

An unhandled exception of type 'Microsoft.Xna.Framework.Content.ContentLoadException' occurred in FNA.dll

Additional information: Could not load Ship.fbx asset!

Looks like it's not even supporte internally

                if (typeof(T) == typeof(Texture2D) || typeof(T) == typeof(Texture))
                {
                    Texture2D texture = Texture2D.FromStream(
                        graphicsDeviceService.GraphicsDevice,
                        stream
                    );
                    texture.Name = assetName;
                    result = texture;
                }
                else if ((typeof(T) == typeof(SoundEffect)))
                {
                    result = SoundEffect.FromStream(stream);
                }
                else if ((typeof(T) == typeof(Effect)))
                {
                    byte[] data = new byte[stream.Length];
                    stream.Read(data, 0, (int) stream.Length);
                    result = new Effect(graphicsDeviceService.GraphicsDevice, data);
                }
                else if ((typeof(T) == typeof(Song)))
                {
                    // FIXME: Not using the stream! -flibit
                    result = new Song(modifiedAssetName);
                }
                else if ((typeof(T) == typeof(Video)))
                {
                    // FIXME: Not using the stream! -flibit
                    result = new Video(modifiedAssetName, graphicsDeviceService.GraphicsDevice);
                }
                else
                {
                    stream.Close();
                    throw new ContentLoadException("Could not load " + assetName + " asset!");
                }

no mention of Model type :/

@flibitijibibo
Copy link
Member

We can't read raw FBX files, they need to be compressed by the XNA content pipeline.

@ghost
Copy link
Author

ghost commented Aug 2, 2016

Oh that sucks :/

@flibitijibibo
Copy link
Member

Yeah. Feel free to write your own reader though, I think the MGCB has a parser for it.

@Alan-FGR
Copy link

Alan-FGR commented Nov 12, 2017

FBX support is no easy problem to solve. Official SDK isn't permissive and assimp doesn't support it very well. There's OpenFBX these days, it's usable but relatively young. Not sure what MGCB uses.

@flibitijibibo
Copy link
Member

If someone wants to come up with Model.FromStreamEXT I'd be willing to merge it, but you have a few requirements:

  • Must be permissive (so yeah, SDK is out)
  • Must support the very old 2006.11 format, per the XNA specification
  • Must not add any new DLLs, or must load the new DLL dynamically with Assembly.Load (so if we add assimp that's how we'll integrate it)

MGCB may have something we can use, but our goal needs to be to contribute to existing model loading code and simply push that through the equivalent of XNA's ModelProcessor. In doing this, we may be able to add other formats as well (obj and the like).

@carlos-ferreira
Copy link

I read here that MonoGame uses assimp to import FBX files. There's even a 3D model viewer that uses assimp to load 3d models.

Is this something we could use or integrate on FNA ?

@thatcosmonaut
Copy link
Member

At this point in time we have absolutely no interest in supporting an official path for model loading. You are more than welcome to pull a library into your project to handle this.

@thatcosmonaut thatcosmonaut closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2023
@FNA-XNA FNA-XNA locked as resolved and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants