Search Unity

[SOLVED] Don't import model, just mesh (FBX / Blender)

Discussion in 'External Tools' started by joshcamas, Sep 16, 2019.

  1. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    822
    Hello!
    I'm trying to get my blender fbx exporter to not export the models associated with my objects, just the meshes. I've found that the models just get in the way and get very frustrating :(




    Any ideas? I'm looking at the blender documentation and I'm not sure what a "model" is even considered to be. Or is this impossible?
     
  2. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    822
    Figured it out! I used

    Code (CSharp):
    1.  
    2. internal sealed class MeshAssetImporter : AssetPostprocessor
    3. {
    4.         private void OnPostprocessMeshHierarchy(GameObject import)
    5.         {
    6.             if (!import.name.StartsWith("msh_")) return;
    7.             GameObject.DestroyImmediate(import);
    8.         }
    9. }
    10.