What I have done currently is request the mesh via Axios to a server, it returns the BASE64 data that I will then use to load the mesh directly. However, loading from BASE64 in my experience has been a little bit slower and freezes the application even when using ImportMeshAssync. Is there a way to use a POST request directly inside the ImportMesh function? Here is a snippet of the current process that I use.
function CreateMainScene(meshURL: string, meshName: string) {
BABYLON.SceneLoader.ImportMesh(
"",
meshURL,
meshName,
scene,
function (newMeshes) {doing stuff with the mesh})};
const convertParams = {
JSON with the parameters of the mesh
};
axios.post(baseUrl + "parameterized", convertParams)
.then((response) => {
let meshData = response.data.data;
console.log(response.data.properties)
CreateMainScene("", "data:base64,"+ meshData);
})