MeshSurfaceSampler problems with some GLB models

Hi Guys, I am struggling trying to figure out what’s wrong with my model.
Basiclly I am playing with MeshSurfaceSampler, and I have some glb models that works and others that don’t works. I have no idea what’s the problem. Here there is a sandbox, as you can see it works with the man model, but the earth model throws an error.

Codepen: https://codepen.io/gaston-pedraza/pen/mdvjdBa

Meshsurfacesampler is expecting a mesh and you’re passing in something that isn’t a mesh, is what it looks like…

Also sometime gltf files have multiple meshes in them since the exporter will break apart models into one mesh per material.

You can use
Glb.scene.traverse(e=>e.isMesh), or similar methods, to find the meshes in your scene.

I solved it.
The problem was in loading the glb model.
I use gltf loader with draco loader and for some reasons I needed to download the draco code and use it in the public folder.

1 Like

Ahh nice! Good job figuring that out!