[gltf-part] does not respect draco compression settings in scene
kfarr opened this issue · 2 comments
Issue:
If the scene
entity has a draco decoder defined in gltf-model
attribute such as "dracoDecoderPath: src/lib/;"
it is not utilized in the gltf-part component and thus the part will not be loaded and the following error is displayed in the console:
Error: THREE.GLTFLoader: No DRACOLoader instance provided.
Expected behavior:
If gltf-model attribute is defined in scene entity and gltf-part is used to load a draco encoded gltf / glb file then the file should decode and display as expected
I was able to get this working:
https://github.com/kfarr/streetmix3d/blob/master/src/components/gltf-part-draco.js
Not sure if useful to submit pull request as I think my method is a bit hacky to get the draco loader in the init
function of the gltf-part
component:
this.dracoLoader = document.querySelector('a-scene').systems['gltf-model'].getDRACOLoader();
I solved this issue by forking the repo and making gltf-part-plus
component which supports draco decompression:
https://github.com/kfarr/aframe-gltf-helpers#gltf-part-plus