Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
122 stars 2 forks source link

Support importing .glb files compressed with Draco #155

Open Zyzyl opened 9 months ago

Zyzyl commented 9 months ago

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

Resonite does not appear to support .glb files which have been compressed with the open source Draco algorithm (see https://google.github.io/draco/ and https://github.com/google/draco). It seems to fail with entries in the log such as:

12:03:14.898 (144 FPS) Exception when importing D:\Neos IO\Bugs\Draco compressed file import\Draco_compressed_cube.glb:

Assimp.AssimpException: Error importing file: class DeadlyImportError: GLTF: Draco mesh compression not supported. at Assimp.AssimpContext.ImportFile (System.String file, Assimp.PostProcessSteps postProcessFlags) [0x00084] in <2bbd770ad2e943ec9a89007d8dfbcb77>:0 at FrooxEngine.ModelImporter+d__6.MoveNext () [0x006fe] in <55e462893e54495b93d49a05f7d7e27a>:0

Draco is actively used to share models online due to the reduced filesizes. It also appears that Draco is the compression algorithm used by Blender if compression is selected when exporting to gltf/glb. As such, it seems native support for these files would be useful.

It seems Assimp should already have support for Draco compressed files as of early 2021 (see https://github.com/assimp/assimp/pull/3614).

Describe the solution you'd like

I would like Resonite to handle importing Draco compressed glb/gltf files as smoothly as it does uncompressed ones.

Describe alternatives you've considered

Pre-importing Draco compressed files into Blender and re-exporting them for use in Resonite.

Additional Context

I attach a zip folder with 2 .glb assets. These are both cubes which were exported under identical settings in Blender (3.6.4) except that the Data > Compression export option was ticked for the compressed one. These can be imported to Resonite using the "Metres" scale option. Draco compressed file import.zip

I also attach a log file from Resonite build 2023.10.13.743 where I first import the uncompressed cube, then the compressed one. The compressed cube error occurs at line 634. DESKTOP-SIS8AVA - 2023.10.13.743 - 2023-10-14 12_02_09.log

FlameSoulis commented 8 months ago

If anything, we need to start grouping tickets that revolve around "Just update ASSIMP already."

Zyzyl commented 8 months ago

I don't think this a "just update Assimp" thing actually. Assimp was updated in build 2023.11.7.274 and importing the Draco compressed cube still throws the same error on that build.

MkEE-Konecny commented 6 months ago

Same problem happens with standard workflow for CAD data - Solidworks default GLTF export has Dcraco compression enabled, all imports fail in that case.

shiftyscales commented 6 months ago

Looked into this a little bit, but am a bit stuck. We use a fork of AssimpNet https://bitbucket.org/Starnick/assimpnet/src/master/AssimpNet/ seen here https://github.com/Yellow-Dog-Man/AssimpNet.

Our current build is based on Assimp 5.2.5 which from all that I've seen should be compatible. So perhaps it could be a build issue, or some missing dependency? Curious for thoughts on this from @ProbablePrime.