GithubHelp home page GithubHelp logo

Unable to load FBX about fna HOT 8 CLOSED

fna-xna avatar fna-xna commented on July 17, 2024
Unable to load FBX

from fna.

Comments (8)

 avatar commented on July 17, 2024

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 :/

from fna.

flibitijibibo avatar flibitijibibo commented on July 17, 2024

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

from fna.

 avatar commented on July 17, 2024

Oh that sucks :/

from fna.

flibitijibibo avatar flibitijibibo commented on July 17, 2024

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

from fna.

Alan-FGR avatar Alan-FGR commented on July 17, 2024

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.

from fna.

flibitijibibo avatar flibitijibibo commented on July 17, 2024

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).

from fna.

carlos-ferreira avatar carlos-ferreira commented on July 17, 2024

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 ?

from fna.

thatcosmonaut avatar thatcosmonaut commented on July 17, 2024

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.

from fna.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.