3 meshes more than expected in the scene without any cause

I use importMesh to import meshes from glb, like below:

And the caller is like:


At the breakpoint at line 83, I checked the total meshes are 2, so far without problem.

And it goes in loop, like below and the breakpoint is line 70:


I checked the scene.meshes, it has 3 more meshes than expected in it. And between 2 breakpoints, nothing done to add any new mesh!

The render view looks like:


The purple outer box is not what I wanted!

Back to debugger, I removed the redundant meshes like this:
image

The result is that the purple box disappeared after the program got free from debugger. see below:
image
And the black background is my want.

I am confusing why there are 3 redundant meshes(purple box in the view), though application does not add them.

Note: The gbl files are sourced by NASA.

Can you please try to reproduce your issue in the Babylon.js Playground (babylonjs.com) so we can help you more efficiently?

You’re probably call scene.createDefaultEnvironment() (or createDefaultSkybox?) somewhere in your code? It looks like so.

1 Like

Yup I can see the environment

which is at least a box and a ground :slight_smile:

2 Likes

I am a Babylonjs starter. Some low level problems will confuse me for a long time :smiling_face_with_tear:
Thank you for your suggestion. Just to learn more useful tools for the work.

Yes. And adding “mesh.material.usePhysicalLightFalloff = false” will avoid call createDefaultEnvironment.
Thanks