Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback ScriptedImporterAttribute handling blocks multiple importers for the same file type

Discussion in 'Scripting' started by bitinn, Mar 4, 2022.

  1. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Hi Unity team,

    While working on testing glTF interoperability across multiple Unity plugins I discover this issue:

    - As of Unity 2021.2.x (and likely Unity 2022 beta / Unity 2020 LTS), when you have multiple scripted importers targeting the same file type, then 2 problems exists.

    - If 2 or more of them declare
    fileExtensions
    property, then Unity log "Multiple scripted importers are targeting the extension" error and disable all importers.

    - If all of them only declare
    overrideFileExtensions
    property to avoid conflict, then the Inspector show no Importer dropdown for the file type, so the file cannot be imported.

    Screenshot 2022-03-04 144830.jpg

    - This means there isn't a way for an open-source author to declare a ScriptedImporter implementation without conflicting with other importer of the same kind. ScriptedImporterAttribute requires 1 and only 1 importer to declare itself as "default".

    And for glTF there are many such importers.

    I hope Unity team can address this problem by showing Importer dropdown even if there is no "default importer" declared.

    Screenshot 2022-03-04 145217.jpg

    Thx!
     
    Last edited: Mar 4, 2022
  2. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
  3. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    I gave glTF in Unity a chance and this is what I got so far :)

    Export-Table.jpg
     
    ina likes this.
  4. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,080
    This is a good test! Curious what is the latest? Also, do you know the cross platform support of each one?