prefrontalcortex / UnityGLTF

Runtime GLTF Loader for Unity3D
MIT License
163 stars 41 forks source link

fix: Avoid null pointer de-reference on sparse accessors with no buff… #49

Closed atteneder closed 2 years ago

atteneder commented 2 years ago

…er view.

hybridherbst commented 2 years ago

Thanks - yeah, sparse accessors have unfortunately never really been supported in UnityGltf. I added export support for Blendshapes, and there's a PR to add better support that I haven't been able to fully check and integrate yet:

and a branch I had started:

Nonetheless, makes sense to not have exceptions here :)

atteneder commented 2 years ago

Ah, I see.

I have a test glTF (cannot share, not my IP) that uses sparse accessors and this small fix made it work (current prefrontal/master). Thought it's a quick win, but feel free to close the PR if a more complete solution is incoming.

Btw: Do you prefer PRs against prefrontalcortex or Khronos?

hybridherbst commented 2 years ago

Currently against prefrontal cortex, once the merge has happened against Khronos I assume :)

When you say "this made it work" I'm a bit confused: I don't think there's proper code yet to actually use sparse accessors on import, so not sure if files can actually be working right now.

hybridherbst commented 2 years ago

@atteneder latest dev branch (and tag 1.7.1-pre) has fixes for Sparse Accessors; that's not complete but there's some support now. Would be great if you could test your file against that version when you've got time – thanks!

atteneder commented 2 years ago

@hybridherbst Said 3 models are working now. Thanks!