when i use Sceneload.Importmesh model load instant on the stage and when use Sceneload.AsyncImportmesh the loading of model goes slow
createCup(){
var self = this;
If you want to find the difference between BABYLON.SceneLoader.ImportMesh and BABYLON.SceneLoader.ImportMeshAsync
If you import a piece of code from within your own project, you won’t be able to tell if the problem is in the before or after code. so reproduce using in PlayGround
Or as your self confirmation without any other conditions purely by importing without any conditions to check the speed
It may be slightly slowed down by logic or ordering within the project, but If it becomes very slow, as you say, that would be a problem.
The problem is that when I am loading the import mesh on the stage, the model is loading instantly.
SceneLoader.ImportMesh(null,
// “./assets/models/”,
self.modalPath,
null,
self.scene,(function (frame, paticlesystems, skeleton, animationGroups) {
self.scene.createDefaultCamera(true, true, true);
self.meshes = frame;
console.log(self.meshes);
self.animationgroups = animationGroups;
}) this much of code
and when i call these functions inside of import mesh than it goes slow and take 30 second and glb file size is 857kb
if(self.animationgroups.length !== 0){
self.ifanimatedproduct = true;
self.animationgroups[0].stop();
}
self.updateMaskedArea();
if (self.selectedPaper) {
self.showPaperColorOption(self.selectedPaper);
}
self.setcameraposition(self.scene);
Try eliminating the culprits one by one
The above implies that synchronous and asynchronous loading are basically the same, right?
If so, it’s the following code that makes the difference
It sounds obvious, but
There may be some form of duplication of effort or slowdown due to empty values in what is called inside the following functions.
Other things
check model(common causes is it)
you using library( react.js , next.js …) did you do scenes and engines dispose correctly?
This is my guess from what you have provided and you may have already found the answer Inside your project
For the insight of other users looking at this topic, may we ask you to provide just a small explanation towards how you fixed the issue on your own (congrats )? And then, could I also ask you to kindly mark your post/finding as ‘the solution’ in order to avoid people trying to solve an issue that is no longer an issue
Glad you found your way around it and meanwhile, have a great day