I’m trying to load a glb with draco compression as a base64 encoded string and getting an error.
Unable to load from data:;base64,{the entire base64 string}: Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.
The documentation says " The pluginExtension parameter should be set when using base64 data urls in order to ensure the correct plugin is used to load the model."
I’m guessing/hoping that all I need to do is provide a string to use the draco plugin, however I can’t find any examples of what the pluginExtension string should be. I tried “draco” and “KHR_draco_mesh_compression”, but get an error message about the plugin not being found.
You can see in my comments (line 460-462) that before hitting the line with the error (line 463), the file was already successfully loaded with GltfFileLoader. It also runs properly through the gltf validator (line 458). The reason that it is being loaded as a base64 string is to streamline handling either gltf or glb files from either a web browser or node.js with null engine.
Unfortunately, passing ‘.gltf’ as the pluginExtension doesn’t seem to work in this case.
It may be an underlying issue with SceneLoader in the NodeJS + NullEngine context. I created a sample project to demonstrate the issue that I’m seeing.
I am able to load the draco compressed data with GLTFFileLoader, but not SceneLoader.AppendAsync. I’ll probably switch to GLTFFileLoader to fix the Asset Auditor issue, but I wanted to report my findings in case there is an underlying issue with SceneLoader or to learn if I’m just not using it properly.
I also created a playground to show that it does work in the browser: Babylon.js Playground
This is a problem with Tools.GetAbsoluteUrl in a node environment. I updated to code to try to make it work which got past the first problem. Then it complained about XMLHttpRequest not being there. I polyfilled it, which got past that problem. But it still doesn’t work unfortunately. The code tries to load the Draco scripts into the environment but the code for loading scripts doesn’t work in a node environment. @MikeFesta If you can file a feature request on GitHub, we can look into more, but we are going to release 6.0 soon, so this may not happen quickly.