- Home /
How save assets as fbx in Unity3d?
I generate model buildings dynamic in Unity3d. After generated I have many count of Meshes in Scene. How save its in fbx?
I'm not sure on the .fbx file structure, but it would be quite simple to export to .obj format, which could be fine as long as you don't have animations involved? There would be a way to export to fbx obviously, but I would not want to spend the time working it out, and there are lots of free .obj to .fbx converters around (blender does it).
To .obj, you would run through your meshes and simply read each one into the very simplistic format of .obj, which you can find some material on here
I don`t may use format .obj, because its could not save transform of meshes. I have many gameObjects, that contains the same mesh, but with some transform (move, scale or rotate). If I use obj then its generate for each new transfrom gameobject new mesh - Its very bad, because I generate assetbundles for its (very big size of assetbundles became).
Answer by Bunny83 · Nov 05, 2015 at 02:37 PM
You simply can't without a third party library. The Unity engine can't handle fbx files at all. Only the Unity editor has an FBX file importer. It can't create FBX files. Unity is not a modelling tool.
As @das4898 said you can use AssetDatabase.CreateAsset to store the mesh / gameobject into an file in Unitys asset file format. When Unity "imports" an fbx file it also get converted to that format. The main asset is a gameobject while they add the Mesh asset as subasset. The subassets can be seen when you "expand" the asset in Unity.
Since 2005 the FBX SDK is free, however it's a C++ library. It will help in the process to convert a whole gameobject with meshes into an FBX, but you have to write the exporter yourself.
Things created inside the Unity editor are best saved as assets in Unity. If you want to create things for usage outside of Unity, that's not possible. You would have to export the data yourself. Again: Unity is a game engine and the Unity editor is a game authoring tool. It's not ment to actually create assets.
Answer by anildas · Nov 05, 2015 at 01:15 PM
@utyasheva.irina Your question is not very clear. If you meant to ask, how to save dynamically created prefabs into the disk, you might want to see AssetDatabase.CreateAsset() method.
Hope it helps. Comment in the thread, if your issue is different.
$$anonymous$$y question: How save gameobjects with their meshes and materials in fbx?