Open harisbal opened 2 years ago
I assume glb is a binary format? We could load it on the Python side, serialize it literally to JS as we do with Numpy arrays, then use that ArrayBuffer
on the JS side?
@kylebarron GLB is the binary format of GLTF. I believe pydeck has implemented a mechanism to transport binary data. We have an experimental feature on the JavaScript side to resolve data locally:
deck._addResources({my_model: <uint8array>}); // a resource is arbitrary content
const layer = new ScenegraphLayer({
...
scenegraph: 'deck://my_model' // this will resolve to the above content
});
deck.setProps({layers: [layer]});
Thanks for the background; I've never worked with 3D models myself.
I believe pydeck has implemented a mechanism to transport binary data.
Yes, in https://github.com/visgl/deck.gl/blob/master/bindings/pydeck/pydeck/data_utils/binary_transfer.py we have implementations for serializing a Numpy array to a binary format, and then passing that binary data over Jupyter's "Comm" Mechanism to the JS side. So we'd just need to adjust _prepare_binary_data
to handle other data objects than Pandas DataFrames. In this case, we'd just need to accept the binary data blob given by the user.
Hello. Is there any possibility to add this feature in the near future?
Discussed in https://github.com/visgl/deck.gl/discussions/6323