Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve glTF plugin compatibility with newer ScriptedImporterAttribute syntax #1576

Closed
bitinn opened this issue Mar 4, 2022 · 3 comments
Closed

Comments

@bitinn
Copy link

bitinn commented Mar 4, 2022

Is your feature request related to a problem? Please describe.

I am testing interoperability across various glTF plugins for Unity, and run into an issue between multiple ScriptedImporter declaring itself as default importer for glb or gltf file type.

Unity will disable all importers for glb and gltf files upon seeing this, and an error will be logged:

Multiple scripted importers are targeting the extension 'glb' and have all been rejected: ...

Describe the solution you'd like

This fork of UnityGLTF is the only plugin that doesn't conflict with other glTF importer via the use of overrideExts in ScriptedImporterAttribute (an added feature since 2020.2).

https://docs.unity3d.com/2022.2/Documentation/ScriptReference/AssetImporters.ScriptedImporterAttribute.html
https://github.com/prefrontalcortex/UnityGLTF/blob/master/UnityGLTF/Assets/UnityGLTF/Editor/Scripts/GLTFImporter.cs#L24

Describe alternatives you've considered

N/a

Additional context

I have tested this change to work:

Screenshot 2022-03-04 145217

Note: there is however a current problem that cause Importer dropdown to not show up, we are waiting for Unity to address this issue or provide workaround:

https://forum.unity.com/threads/scriptedimporterattribute-handling-blocks-multiple-importers-for-the-same-file-type.1248427/
prefrontalcortex/UnityGLTF#37

@bitinn
Copy link
Author

bitinn commented Mar 4, 2022

Side note: these are the compatibility of GLB file across various popular glTF plugins.

Export-Table

@ousttrue ousttrue added this to the v0.99 milestone Apr 28, 2022
@ousttrue
Copy link
Contributor

Thank you for reporting.
overrideExts looks good.

The orientation of the model is affected when converting gltf (right handed) and unity (left handed).
UniGLTF has historically used z-axis inversion for both import and export.
UniGLTF can change the axis to invert.

The model indices exported by glTFast appear to be failing.
Perhaps UniGLTF does not have an implementation of the unsigned byte type.

@ousttrue
Copy link
Contributor

ousttrue commented Jun 8, 2022

overrideExts will be in v0.100.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants