How to set DracoLoader path?

I tried adding my own GLTF loader which works fine but I want to add a Draco Loader to it, so I have to use the line

        dracoLoader.setDecoderPath( '/examples/js/libs/draco' );``` 
which in the build gives me: `https://demo.epm.digital/examples/js/libs/dracodraco_wasm_wrapper.js`
Is there a different path I should use?  I import it with `import { DRACOLoader } from "three/examples/jsm/loaders/Dracoloader.js"`

<https://discourse.threejs.org/t/issue-with-setdecoderpath/9556>

[Original Post on Discord](https://discord.com/channels/717429793926283276/1051898340016656456)

*by user 103054507105067008*

Trying dracoLoader.setDecoderPath( './include/draco/' ); now

by user 103054507105067008

That gives me GET https://demo.epm.digital/modelpreview2/include/draco/draco_wasm_wrapper.js 404 (Not Found)
The only files in that folder though are draco_decoder.js and draco_decoder.wasm

by user 103054507105067008

Had to manually add draco_wasm_wrapper.js from another random folder in node modules in C:\Unity_Projects\ProjectName\projects\ModelPreviewer\dist\include\draco

by user 103054507105067008

You can set it on the engine element (see code in engine/engine_element) in there you find code to do it :slightly_smiling_face: sorry not on the pc right now

Why do you want to use your own loader?

I have made an in-house model previewer for a project where we can use a url parameter to get the url to a file on the server to load with gltfloader. Works great now thanks!

by user 103054507105067008

That doesn’t quite answer Marcels question, what you described absolutely doesn’t need a custom loader - what are you trying to do? :smile:

I assume what you want to do is just “load some custom glTF from inside Needle Engine” in which case you can just use our loader-on-steroids

(which comes with draco and our extensions and animation pointer etc.)

You find a handy method to use that loader in engine_scenetools (loadSync for url or parseSync for binary) or you can just create a new AssetReference via the static Create method and provide the correct arguments

You can of course load completely separate as you do - would be interesting to hear the reason for it tho

I was just loading from a local FTP server url, where shall I look for an example of using your loader to load a model from a url? I couldn’t quite see where to do that

by user 103054507105067008

Will look into the engine_scenetools you mentioned :+1: Still using droploader in this build for drag dropped models though of course, just url parameter loaded models come from the url

by user 103054507105067008

Example of what I was doing https://demo.epm.digital/modelpreview/?file=https://demo.epm.digital/models/test/BarramundiFish.glb

by user 103054507105067008