I want to export an object as a .fbx at runtime in Unity3D.

I've made a C# script to export a mesh filter or skinned mesh renderer to a .obj file at runtime, but I want the animation and skin support that only .fbx supports.

After some research, using the Autodesk FBX SDK or some other external .dll seems like my best option. How do I call Autodesk's FBX SDK at runtime? Is there another external .dlls I could use for this?

Another option could possibly be to write the mesh information as a text file, then convert to .fbx to export.

  • 4
    \$\begingroup\$ Does it have to be FBX? That's a proprietary, mostly undocumented format that most people can only access via the FBX SDK. Compare to, say, Collada, which is open and well-documented and should work in whatever tool you're loading the generated FBX into. \$\endgroup\$ – Sean Middleditch Jun 27 '13 at 5:46
  • 4
    \$\begingroup\$ More to the point, why are you exporting at runtime? There might be another solution for what you actually want to do other than the solution you think you need to do. \$\endgroup\$ – Tetrad Jun 27 '13 at 7:42
  • \$\begingroup\$ Does Collada support skinned mesh renderers and animations? If so something like that may work, I was just told FBX because of the information it can hold and because it works for any 3D platform. And I'm exporting at runtime because that's the entire purpose of this script, essentially the user can adjust the mesh and textures on their character, then press an "Export" button and download the textures and .fbx for the character. This is all done in the web player, I have it working with textures, animations, and .OBJ. But I'd like .FBX because it supports skinned mesh renderers and animations \$\endgroup\$ – Timothy Williams Jun 27 '13 at 17:02
  • \$\begingroup\$ However, if I could export to another supported 3D format that would be able to hold skin information and special animation information that would work even better than .FBX. \$\endgroup\$ – Timothy Williams Jun 27 '13 at 17:03
  • \$\begingroup\$ @TimothyWilliams Collada supports skinning and animations. \$\endgroup\$ – SurvivalMachine Feb 19 '14 at 11:46

Autodesk has a FBX Converter, which can take .objs and output .fbx. Included is a command line tool, which you could call from your game at runtime. As long as you do not want to have that functionality distributed to every player, that should be enough.

  • \$\begingroup\$ Though the comments above are useful, this does directly answer the question. \$\endgroup\$ – Seth Battin Apr 17 '14 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.