How to use parse method with DracoLoader

Hello everyone,
I’m trying to load my PLY compressed files with draco (.drc) with DracoLoader from a buffer not a path, I tried to use the parse method but apparently it doesn’t exist in DracoLoader since I have this error when I tried to use it, Uncaught TypeError: dracoLoader.parse(…) is undefined
here’s the my DracoLoader code :
async function loadVolumetric(){ for (let i = 0;i<1;i++){ dracoLoader.loadAsync( 'models/ply/ply/lootout'+i+'.drc') .then( geometry =>{ geometry.scale(0.0006,0.0006,0.0006) frames[i]= new THREE.Points( geometry, dotMaterial ); loadedframe ++ ; }) ; } }

Could you help me please use a parse or a URL.createObjectURL method in this case?

the parse method was only just added, and will be in the r150 release. is that an option for you?

1 Like

Thank you for your replay, that will be great having the parse in DracoLoader but I have to run a demo this week and I want to make the loading from the buffer possible, is there a way to do that before the realease of r150 ?
Best regards

It’s an internal API but you could use…

loader.decodeDracoFile( buffer, onLoad ) 

… in the meantime. The buffer should be an ArrayBuffer, like you’d get from the Fetch API:

const response = await fetch('path/to/file.drc');
const buffer = await response.arrayBuffer();
1 Like