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

Will not nload gltf on iOS but same code works on Android #133

Closed
alexs7 opened this issue Apr 12, 2021 · 15 comments
Closed

Will not nload gltf on iOS but same code works on Android #133

alexs7 opened this issue Apr 12, 2021 · 15 comments
Labels
bug Something isn't working help wanted Extra attention is needed mac error specific to apple systems

Comments

@alexs7
Copy link

alexs7 commented Apr 12, 2021

I am downloading a model and then loading it as:

string modelPath = Path.Combine(Application.persistentDataPath, model_file_name);
Debug.Log("Loading, model from disk...");
Debug.Log(Application.persistentDataPath);
Importer.ImportGLTFAsync(modelPath, new ImportSettings(), OnFinishAsync, OnProgress);

And on XCode I get this:

Mesh 12 import error
Siccity.GLTFUtility.<OnCoroutine>d__5:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Siccity.GLTFUtility.<TaskSupervisor>d__17:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Not sure what is going wrong here ? Any help ?

@Siccity
Copy link
Owner

Siccity commented May 11, 2021

Try loading it sync, see if that error is more helpful

@alexs7
Copy link
Author

alexs7 commented May 11, 2021

The problem was with the draco compression. sometimes when you use draco compression, the loader does not work on iOS.

@seancheno
Copy link

I am receiving same error with draco compressed models on IOS. Any potential fix for this or should we just stay away from draco compression for now?

@paul-bonnel-fr
Copy link

There is an issue on iOS when loading glb with draco compression. Same code, same glb works fine in Android and the Unity Editor but the loading the glb with draco compression fail on iOS....
Does someone have a solution or a workarround ?

@atulafternow
Copy link
Contributor

@Siccity and @paul-bonnel-fr Yes I am facing the same issue Draco compressed glbs is not working on uwp and ios.
when I was looking for the reason for this issue and found that we don't have Draco dll for UWP and iOS and that's why it's not working.

@Siccity
Copy link
Owner

Siccity commented Nov 12, 2021

Unfortunately I do not have a Mac to test with. I can only wait for a pull request

@Siccity Siccity added bug Something isn't working help wanted Extra attention is needed mac error specific to apple systems labels Nov 12, 2021
@atulafternow
Copy link
Contributor

Hey, @Siccity could you plz tell me which Draco repository u have used?

@paul-bonnel-fr
Copy link

I've tried importing the iOS draco plugin for Unity from this repo https://github.com/google/draco/tree/master/unity/Plugin without success any ideas ?

@Siccity
Copy link
Owner

Siccity commented Nov 15, 2021

@atulafternow
https://gitlab.com/atteneder/DracoUnity

@atulafternow
Copy link
Contributor

atulafternow commented Nov 15, 2021

@Siccity @paul-bonnel-fr i have tested the fix for ios and testing it on UWP . Plz review the PR #166 guys

@hdeppert
Copy link

hdeppert commented Nov 19, 2021

I see #166 is already merged, so this issue should be fixed?

@Siccity BTW: seems that DracoUnity repo has moved to Github for quite some time: https://github.com/atteneder/DracoUnity

@Siccity Siccity closed this as completed Nov 19, 2021
@FreshlyBrewedCode
Copy link

FreshlyBrewedCode commented Mar 23, 2022

I am unable to load a Draco compressed .glb file on HoloLens 2 (UWP ARM64). I tried loading it syncronously from file and asynchronously from byte array but I the logs show the same error:

Mesh 0 import error
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
Siccity.GLTFUtility.<OnCoroutine>d__5:MoveNext()
Siccity.GLTFUtility.ImportTask`1:RunSynchronously()
Siccity.GLTFUtility.Importer:LoadInternal(GLTFObject, String, Byte[], Int64, ImportSettings, AnimationClip[]&)
Siccity.GLTFUtility.Importer:ImportGLB(String, ImportSettings, AnimationClip[]&)
Siccity.GLTFUtility.Importer:LoadFromFile(String, ImportSettings, AnimationClip[]&, Format)
Siccity.GLTFUtility.Importer:LoadFromFile(String, ImportSettings, Format)
GLTFImportTest:Start()

The logs also show that the dracodec_unity.dll is loaded:

Loading native plugins
  Loading dracodec_unity.dll

The same model does load without problems in the Unity editor running on Windows.

One of the models I used for testing was: https://github.com/KhronosGroup/glTF-Sample-Models/blob/master/2.0/Duck/glTF-Binary/Duck.glb compressed using gltf-pipeline.

Any suggetions for further troubleshooting?

Update: when I try to load a draco mesh using DracoMeshLoader on UWP I get the following exception:

EntryPointNotFoundException: Unable to find an entry point named 'DecodeDracoMesh' in 'dracodec_unity'.
  at DracoMeshLoader.ConvertDracoMeshToUnity (System.Byte[] encodedData, System.Collections.Generic.List`1[UnityEngine.Mesh]& meshes) [0x00000] in <00000000000000000000000000000000>:0 

@tafkag
Copy link

tafkag commented Jul 5, 2023

@FreshlyBrewedCode I have the exact same issue ("Mesh 0 import error), trying to import a draco compressed gltf file from the StreamingAssets folder on Hololens 2. Did you find a solution to your problem?

I can load non-compressed files without any problems and copied the WSA/ARM64 dracodec_unity.dll into the Plugins folder, but can't get past the import error message.

@FreshlyBrewedCode
Copy link

@tafkag I never found a fix unfortunately.

@beyondnations
Copy link

still no fix for this? draco compression problem on ios?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed mac error specific to apple systems
Projects
None yet
Development

No branches or pull requests

9 participants