Search Unity

Feedback [Feedback - Feature Request] The ability to disable importing of specific files in the project

Discussion in 'Editor & General Support' started by tonycoculuzzi, Apr 25, 2019.

  1. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    What?
    I'd love the ability to enable/disable importing on specific files (or even file types) in the project. I've listed some reasons below as to why this could be useful.

    To be clear, this would need to be an asset state applied to a file's metadata, making it persistent across all user's versions of the project. Not a temporary per-install or per-computer setting on files.

    While I know it's possible by creating a custom tool, I'd love the built-in ability to disable importing specific files, from each file's import settings. Every time I've attempted to create something like this, I always run into issues. (Like Unity always needing to import the assets at least once when the Library metadata is being built/rebuilt, etc)

    I feel like it could work the same way as enabling/disabling a Game Object. The Importer inspector could have an "Enabled" or "Import" checkbox in the top left corner that would prevent Unity from reading and importing the file. While importing is disabled, double-clicking the asset could still open the file in it's associated editor (like Photoshop, or Blender, etc)

    From a programming standpoint, it'd be really great if import-disabled assets could have their own Asset type (like NonImportedAsset or something) similar to the Asset types of MonoScript, or TextAsset, etc. This would allow us to easily search for import-disabled assets and create tools revolving around that kind of workflow.

    I've made a mockup here:




    Why?


    The reason I'm bringing this up is because I know a few people, myself included, that store large master files inside the Unity project, usually in the same folder as sub-assets that can be exported from that master file.

    Here are some examples:

    - A large PSD containing slices/layers for different UI elements, which is exported to individual PNG files through a tool or from photoshop) into the same Unity folder.

    - a 3D DCC file (.blend, .c4d, etc) which contains a large scene, all of which need to be exported to separate FBX files in the same folder

    - A 3D DCC file (.blend, .c4d, etc) that is intended to be exported to FBX into the same folder (avoiding Unity's sometimes inconsistent exporting-to-fbx functionality



    This workflow would help us keep all our files in one place, without having to manage multiple file locations and export paths. Currently, any large assets that are being used as a "master" file are still imported, which usually takes up a lot of library-building time, and more importantly, these master files can be mistaken for final assets which can lead to confusion.


    Going a step further, it'd be great to be able to disable importing of specific file types altogether too, in the Project Settings or something. For example, disabling all .BLEND files from importing, or .PSDs, etc.
     
  2. DreamPower

    DreamPower

    Joined:
    Apr 2, 2017
    Posts:
    103
    Sounds like it'd be just as good to use the existing system where you use a separate folder (or filename) that ends with a ~ in the name. That would be more organized and easier to see which files aren't being built, leading to less confusion.
     
    BackgroundMover and karl_jones like this.
  3. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    Adding ~ to the filename or folder will completely hide the file from the Unity editor, making it hard to open from Unity, and making it impossible to handle these files using custom editor tools (like a tool that opens a PSD, exports all slices into the same folder)
     
  4. Ziflin

    Ziflin

    Joined:
    Mar 12, 2013
    Posts:
    132
    @tonycoculuzzi This has been an issue for us for a while as well. There was a feature request for it at one point I believe, but those all vanished. I'd settle for a way to simply disable auto-import for all files of a certain type (ex: .blend) in the project settings. This would let us store Blender files in the same folder alongside the .fbx or .glb export without Unity trying to process the .blend files.

    The best workaround that I've come up with so far for this issue is to simply rename all .blend files to .blender and then assign .blender files to Open with Blender in Explorer which Unity will also use. (I wrote a bit more about it in this article.) Ideally Unity would just add the project settings options though. It's very handy to have the source assets alongside the imported files for a number of reason.