Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Rename binary data asset file with a different file extension

Discussion in '2019.1 Beta' started by bitinn, Dec 10, 2018.

  1. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    This is something I always wanted Unity to do, but Unity 2018 was too late for that.

    Terrain Data and Lighting Data asset files are, AFAIK, the only 2 types of data that doesn't conform to Unity YAML standard but still use *.asset file extension.

    I suggest renaming them in future as this is making git integration unnecessarily difficult: suppose a user would like to use git-lfs to track binary data, they need to handle both cases with .asset is YAML and cases where it is binary.

    And since .gitattributes only match based on file path patterns: users will either have to name these binary asset file in some ways or put them under specific folders, neither were perfect workarounds as they require extra communication between team members.

    I have created my own pre-commit script just to avoid committing large binary asset file.

    I know this is not an easy change, and we use Unity 2018 so this change won't benefit us immediately, but I just want to putting this idea out there.

    Thx for reading.
     
  2. harryr

    harryr

    Unity Technologies

    Joined:
    Nov 14, 2017
    Posts:
    38
    To my knowledge there's currently three built in unity asset types that will always be serialized as binary but still use the .asset extension. Terrain Data, Lighting Data (as you said) but also NavMesh data.

    Thanks for showing us how you're currently dealing with this, we've now started an internal conversation about renaming these asset types.

    I just wanted to add a suggestion that might allow you to work out what .asset files are binary or not

    $ head -n 1 path/to/asset
    should return "%YAML 1.1" for text serialized assets.

    Adding this check would allow you to still keep large text assets out of git-lfs.
     
    Rallix, LeonhardP and bitinn like this.