Unity Community


Results 1 to 4 of 4

  1. Location
    California
    Posts
    1,657

    Custom asset formats - can someone from Unity Technologies support help?

    I am attempting to create an asset importer that will read in a custom file format and have Unity recognise it, parse it, and place it in the asset database. I have chased my tail on this problem for the better part of two weeks trying to find the right combination of function calls and classes to make this work. I have investigated AssetPostprocessor, AssetImporter and read everything I could find on the forums, Unity answers, and every published book concerning Unity on how to do this particular task and nowhere is the process documented. The documentation of creating a custom asset importer and having Unity invoke it when an asset of that format is brought in to the Unity editor is obtuse and poorly detailed.

    I've asked on the forums (in two different ways), I've asked on Unity answers, and I have yet to see any response that addresses the problem.

    In all the years that Unity has existed I find it unbelievable that nobody (at least, nobody that reads the forums) has ever needed to import their own asset formats.

    Can someone from Unity Technology actually answer this question or direct me to a resource that solves it?

  2. Product Manager



    Location
    Moon
    Posts
    360
    Bump.

    I need to do this too. Anybody?


  3. Location
    Kaunas, Lithuania
    Posts
    664
    There is no proper way to do this, i.e. Unity doesn't expose convenient way to perform this.

    I would say there are two parts:
    1) Import your custom file into Unity
    2) Trigger file import when file changes

    First part can be done by just writing some scripts, which open your file, parse it and create necessary prefabs/meshes/texture/hierarchies in Unity project.

    The second part is automating this process. I think the only way to do it is using AssetPostprocessor.OnImportAllAssets (or something like that). In that method you would have to check if any of your custom files have changed and then trigger reimport based on that.
    @pauliusliekis | Ex Unity developer
    http://pixel-punch.com | Development of Unity, Augmented Reality and general 3D projects


  4. Location
    California
    Posts
    1,657
    Thanks for the clarification. It is as I suspected. My solution at this time is to have separate asset processors that export to a recognised format that Unity is aware of or a custom binary format that I can interpret inside of Unity by reading the bytes directly from a "TextAsset."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •