Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Default Import Settings?

Discussion in 'Editor & General Support' started by mrmcduck, Oct 20, 2019.

  1. mrmcduck

    mrmcduck

    Joined:
    Nov 26, 2015
    Posts:
    26
    I'm looking for a way to set default import settings. For example: Every FBX file added to the project, should per default not import materials / animations.

    I am aware of the Assetpostprocessor, but these methods are not called just on import, but on any change, only allowing to lock the settings.

    In the past I managed to trick it by using the following lines, but this does not work anymore since 2019.3 (I assume it has to do with the new AssetPipeline v2, which seems still to be fully undocumented).
    Code (CSharp):
    1. var importer = (TextureImporter)assetImporter;
    2. string name = importer.assetPath.ToLower();
    3. if (File.Exists(AssetDatabase.GetTextMetaFilePathFromAssetPath(name)))
    4.     return;
    Am I missing something or is this in my opinion crucial piece of usability missing?
     
  2. mrmcduck

    mrmcduck

    Joined:
    Nov 26, 2015
    Posts:
    26
    Bump.
     
  3. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,269
    The problem is that any file change will trigger a import.
    You can build your own import script that handles your specific needs.