@Evgeni_Popov got that. If you click on play again and again, you’ll notice that the custom mesh gets generated first and then imported mesh is created. But if you click on play again and again quickly then the imported mesh just doesn’t get rendered.
Since in my case the mesh vertices are changing every second could this be an issue of why I am facing issues locally?
I think your .obj is not valid because there is this warning in the console log:
babylon.js:16 BJS - [15:44:01]: Setting vertex data kind 'position' with an empty array
It seems one of your mesh is empty(?).
However, even with the warning, when I keep pressing play I still get everything displayed correctly (except of course if I click too quickly for the obj mesh to have time to be loaded before the refresh!).
Also @Evgeni_Popov adding scene.createDefaultCamera(true, true, true);
after newMeshes[0].scaling = new BABYLON.Vector3(0.100, 0.100, 0.100);
doesn’t do anything locally and all I see is the rendered head
and adding scene.createDefaultCamera(true, true, true); just before return scene as in the playground result in a blank canvas
Unfortunately, without a proper repro I won’t be able to help much more.
You should start with something that works (take the code from the PG in this thread) and add progressively your own code and see when it stops working.
So I added the debugger by scene.debugLayer.show();
and it shows that the cap mesh has been successfully imported to the scene and the previously existing face mesh is its parent too
But it’s still not visible still due to some weird reason
It may be nothing to see, but I had a problem like this once using an octree after my scene loaded. Then when I added new mesh afterwards, I did not update the octree. I ended up with meshes not visible.
But you may not be using octree, so my post may not help. But it happens that a problem comes from there or we do not expect it.
Interesting. But what I have here is a obj file (linked above) that I exported from Maya. I’m trying to import that into an existing scene with a custom mesh.
So issue not related to octrees i guess (?)