I am loading strings of glb files like in this example https://playground.babylonjs.com/#7F6S08#2.
Our code is pasted below. Now we get the glb files and encode them to base64. After the loading process is exactly the same. I get following error:
logger.ts:83 BJS - Unable to import meshes from blob:http://localhost/3bd4aca6-d21c-4acc-980b-bd11181c063a: Length in header does not match actual data length: 96321519 != 1516
I think the encoding from glb string to base64 but cant see what i do wrong. I encode it with this line:
let base64String = Base64.encode(data)
var base64_model_content = "data:base64," + base64String;
var raw_content = BABYLON.Tools.DecodeBase64(base64_model_content);
var blob = new Blob([raw_content]);
var url = URL.createObjectURL(blob);
return BABYLON.SceneLoader.Append(null, url, scene, undefined, undefined, undefined, ".glb")
.then(function (result) {
let bimProducts = geometryMap[checksum];
positionMesh(result.meshes[1], bimProducts[0].position, bimProducts[0].rotation, bimProducts[0].ifc_guid);
assetContainer.meshes.push(result.meshes[1]);
for (let i = 1; i < bimProducts.length; i++) {
let clone = result.meshes[1].clone(bimProducts[i].ifc_guid);
positionMesh(clone, bimProducts[i].position, bimProducts[i].rotation, bimProducts[i].ifc_guid);
assetContainer.meshes.push(clone);
}
});