Advertisement

How to make a parser for fbx

Started by December 31, 2011 03:55 AM
5 comments, last by Gavin Williams 12 years, 11 months ago
I was wondering if there are any tutorials on how to write a parser so I can parse a .FBX file into my own format. I'm using 3ds 2011 to make my models and if you have any suggestion of a better format to export to I'd like to hear that as well. Any suggestions and advice will be greatly appreciated.
I wouldn't try to parse FBX. There's a library available for extracting information from it, isn't there?

I've heard painful stories of people trying to extract info from FBX. Seems great as a format to interchange between apps, maybe overcomplicated for someone's pet model format

I personally just use JSON and wrote an exporter to get the data I need in an easy to understand format
Advertisement
Thanks for the suggestion though I'm using C++ and JSON is for Java correct?
I believe there is an FBX sdk, you can probably find it at the autodesk site. Although I would advise against using a complicated format like fbx if you have 3d studio. Youre probably bettter off building a plugin with the 3ds max sdk that exports to your own format.
There are C\C++ libs for JSON, its just formatted text, doesnt really belong to any one language.
Thanks! Appreciate the help.
I remember it took the XNA folks a few iterations to get their FBX importer up to snuff; it's a complex format and not for the faint of heart. If you're interested in supporting one of those grand interchange formats, what about Collada? You could use ASSIMP to gain that support, as well as for other formats too.
Advertisement
I've just specified my own simple model format and loader (in SlimDX / C#). Working on an fbx parser now. Not sure how far I can take it, but I'll let you know in the coming days / weeks how successful I am. If you're using C++, you should look at the Maya API and build an exporter. I would except I hate C++ and refuse to use it. And as mentioned, there is an fbx sdk, which again is C++, so you should look at that.

If you want to just write your own parser as I am, go for it, what I'm finding is that yes, the file format is very verbose, but you can ignore most of it, just parse through to the objects block, there you'll find your vertices, indices, normals and your UV's. I'm going to constrain my models (to start with) to single mesh models, though I'm guessing it won't be impossible to extract multiple mesh parts, though I'll have to update my Model format first. Even single mesh models should give me a lot of power to start getting models out of max/maya and into SlimDX.

This topic is closed to new replies.

Advertisement