Rendering Group ID for imported mesh not working?

I am importing a 3D model, I am trying to add a rendering group ID so that it renders on top of another plane which also has rendering group ID. Yet, the render scale does not effect it on the imported mesh, what am I doing wrong here?

 BABYLON.SceneLoader.ImportMesh("", "Models/", "scene.gltf", scene, function (vpMesh) {  

             var vp = vpMesh[0]; 
             vp.renderingGroupId = 4;
             }, undefined, undefined, '.gltf');

Probably vpMesh[0] is not what you think.

Try vpMesh.forEach((m) => m.renderingGroupId = 4);

I am getting an error vpMesh.forEach is not a function. What am I doing wrong?

Got it. I was doing vp.forEach()…

1 Like