GitHub: https://github.com/KellanHiggins/UnityFBXExporter Contact: [email protected]
The Unity FBX Exporter is a simple FBX writer designed to export static objects from Unity into the FBX format, preserving the materials, game object hierarchy and textures attached.
It was written for the Unity asset Building Crafter (http://u3d.as/ovC) which allows anyone using Unity to create buildings right in Unity without any modeling experience.
-
Can export any GameObject into FBX format.
-
Supports FBX format 7.3, around 2013.
-
Exports materials into the FBX file.
-
Exports texture references into the FBX file.
-
Can make a copy of all materials and link them to newly minted FBX file.
-
Can make a copy of all textures and link them to newly create materials.
-
Export very deeply hierarchical Game Objects with just a few clicks.
-
Objects will export their rotation correctly throughout the hierarchy (thanks @quickfingerz on Github).
-
Objects will also export their scale correctly (thanks @quickfingerz on Github).
-
FBX format will only recognize diffuse maps and normal maps when exporting. Can not include height maps, for example.
-
Textures only support PBR Unity 5 shaders.
-
Only exports one UV map, not a AO UV 2 map.
-
Sort of works at Runtime. Needs to use File.IO instead of AssetDatabase to truly work at runtime.
-
Sometimes the reimported FBX files don't find the right materials. C'est la vie.
-
Exporting a prefab in the Project Tab sort of works. Needs more testing
-
This is not designed to export Skinned Mesh Renderers properly. It will export a Skinned Mesh into the form that it is currently in in (like a statue). Armatures won't be included.
It is very simple to use this exporter. You shouldn't have any problems, and if you do, please add an issue to the Github project
-
Select any GameObject in the scene.
-
Select the type of export you'd like.
-
Go to Assets menu -> FBX Exporter -> and you have three options (described below).
-
"Only GameObject" will export a new FBX but not create any new materials or textures and use the original as reference
-
"With new Materials" will export a new FBX and create new materials with the GameObject name + _ + material name
-
"With new Materials and Textures" does 2b plus copying textures to a new folder. This one takes a while. Be patient.
-
Wait a bit
-
If you've selected new textures, wait a bit longer. Copying and reimporting the textures takes Unity's brainpower.
-
Check the folder.
-
Usually the materials will align, but if you have a FBX in the root area it may create new materials instead of finding the old ones.
-
Success! You now have a brand new FBX file with everything parented correctly. Remember rotations in children still don't work.
NOTE: Sometimes the fbx file imports the materials as recursive instead of project wide for GameObject only export. If this happens, delete all the materials and reimport the FBX file using Project-Wide for material search.
This was created without owning Maya, so please give feedback on how opening these FBX files work. You can give feedback at [email protected].
Blender 2.70 doesn't take ASCII FBX files. So you'll need to download the converter from the FBX site. Then convert it to a binary file and then import it into blender. Because the relative texture names are correct, blender will import your albedo and normal texture. Pretty neat!
- Skinned mesh renderers may or may not be exporting materials correctly. Did not work on my test object.
- Standard objects throw an error if you try and export them (like the sphere). Still seems to export fine. Also why are you exporting Unity's sphere???
As a note, this project is an MIT license. Which means you can take this code, upload it to the Unity Asset store and charge money for it. BUT, you must include the license (including the bit about Building Crafter) in your project. If you have any questions about this, hit me up.
If you compact it into a DLL and hide all the code away, you still have to include the license somewhere. I'd much rather you come to me then find out you've taken in 4 months later. Don't be a dick, give back to the community!
Version 1.3.0
-
Removed some extra procedural test code.
-
Added some null checks
-
Added check for countries which use commas for decimal points instead of periods.
Version 1.2.0
-
Thanks to @tetreum for fixing my bad tutorial.
-
Also thanks to @tetreum for preventing copying non existent items
-
Thanks to @cartzhang for adding skinned mesh render exporter
-
Thanks to @mikelortega for fixing crash from trying to export materials that are procedurally generated
-
Thanks to @Totchinuko for adding awesome vertex colour export
-
Added an export option from the GameObject menu
-
And thanks to @MadmenAlliance for putting this up on the asset store without proper attribution which forced me to get my ass in gear and pull in all these changes
Version 1.1.1
- Hotfix for something.
Version 1.1.0
- Thanks to @quickfingerz for fixing the rotation export so it looks right in the FBX file.
Versin 1.0.0
- Initial release