Knaus Irina
Knaus Irina

Reputation: 799

How to save assets as fbx in Unity3d?

I generate model buildings dynamically in Unity3d. After they are generated I have lots of Meshes in the Scene. How do I save it as a .fbx file?

Upvotes: 2

Views: 13796

Answers (1)

Yuri Nudelman
Yuri Nudelman

Reputation: 2943

There is this plugin that may help you: https://www.assetstore.unity3d.com/en/#!/content/37276

If you just need to save your models for further use, however, the simplest way to do it is to save them with Unity own format using AssetDatabase.CreateAsset from UnityEditor package, like this:

using UnityEngine;
using UnityEditor;

[RequireComponent(typeof(MeshFilter))]
public class Example : MonoBehaviour
{
    private void Start()
    {
        AssetDatabase.CreateAsset(GetComponent<MeshFilter>().mesh, "Assets/mesh.asset");
    }
}

Or you can use this free plugin to export OBJ: https://www.assetstore.unity3d.com/en/#!/content/15862

Upvotes: 1

Related Questions