Issue with Draco glb decoder

Hi there.
I want to use a compressed glb draco file in my project. Since I just can’t use glb draco in PlayCanvas, I try to decode it into simple glb using the glb-loader (https://github.com/playcanvas/playcanvas-gltf), which I use to extract bytesArray, the draco-decoder-module I found in the PlayCanvas repository (https://github.com/playcanvas/engine/tree/master/examples/lib/draco) and an example from the Draco documentation (https://github.com/google/draco#javascript-decoder-api ).
As a result, I get “outputGeometry” with the value {ptr: 5261840} and don’t know what to do next.
Also, while writing this question, I found a link to the new glb-viewer (https://github.com/playcanvas/playcanvas-viewer), in which I can successfully download draco-glb.
Please explain what I am doing wrong, how to do it right, and if possible show an example of working code.

Here is a link to a test project in which I am trying to implement this:
https://playcanvas.com/project/716316/overview/test

This works for me

LoadFrame.attributes.add('file', {
    type: 'asset'
});

LoadFrame.prototype.initialize = function() {
    const blob = new Blob([this.file.resource]);
    const url = window.URL.createObjectURL(blob);
    
    this.app.assets.loadFromUrlAndFilename(url, "model.glb", "container", (err, asset) => {
        const entity = new pc.Entity();
        entity.addComponent("model", {
          type: "asset",
          asset: asset.resource.model,
        });
        this.app.root.addChild(entity);
    });
};
2 Likes

Yes, it works. Thank you very much

1 Like