New InstancedMesh Warning For No Submeshes

Hey Guys… Some added this line code to InstancedMesh:

 if (!this._sourceMesh.subMeshes) {
            Logger.Warn("Instances should only be created for meshes with Geometry.");

This is not true… A simple cube does not have sub meshes… So now when my scene exports a bunch a Cubes… (Which should be instances after this first one). I get this warning. I imagine this is the case with any simple geometry shapes.

Yo @Deltakosh … Can we please take that out ?

Nope a simple cube has 1 submesh. Only submeshes are rendered so something with no submesh will not render hence it will not have instances

I thought sub meshes had to be explicitly setup… That is what i been doing for a while now for multi-materials.

So whats the deal with simple cubes i export from GLTF and now i get a warning. I dont think i can export the cube mesh any differently. And my other test GLTF viewers (PlayCanvas and Three.js render just fine with no warnings)

Dunno… I dont think i can export any differently though :frowning:

Pinging @bghgary.

Can you share your gltf file with the error? Maybe we are doing something wrong in the loading order

4 Sho … (3.7 KB)

You can open in current sandbox to get the warning.

The difference with the loader is that it creates the instances before the geometry is applied. @Deltakosh I don’t think the warning is correct for these cases as the instanced mesh will be synchronized later after the geometry is applied.

Ok makes sense! I’ll fix that for next nightly

Thanks @Deltakosh and @bghgary :slight_smile: