Instances should only created for meshes with geometry

Yo all,

I suddenly started to get this warning (topic title) since ~2-3 days. Did anything changed on instantiateModelsToScene? It occurs on all my .glb-files, while like 4 days ago everything worked without any warning spamming. Since then I tested CannonJS, AmmoJS and ended at RecastJS formy project. Also what I recognized is that the getClassName()-function returns “InstancedMesh” instead of “Mesh”, is this new?

Here my repro (PG):

It’s a bug in this PR when using instantiateModelsToScene
I forgot to tag people so unsure if they were notified.
@carolhmj @sebavan

1 Like

Oh, I didn’t see this. Taking a look now.

2 Likes

Apologies for this, a fix is on Fix conditions for clone vs instance in AssetContainer.instantiateHie… by carolhmj · Pull Request #13496 · BabylonJS/Babylon.js (github.com)

4 Likes

That was fast! :slight_smile:

looks good!

1 Like

There is still one thing, that isn’t like in the past. My instance.rootNodes[0].rotationQuaternion is undefined even though it is a .glb-file. Usually the root of .glb does use rotationQuaternion.

Does that happen in the PG you showed earlier? I tried logging the rotationQuaternion, but the result is the same on 4.2 and the current version, both are null: Warning Instances only geometry | Babylon.js Playground (babylonjs.com)

Oh my bad, it is null not undefined. Seems strange because I didn’t had the error: instance.rootNodes[0].rotationQuaternion is null before.

Hmmm do you have any playground where the rotationQuaternion is different?

True, in all my PGs i do either use absoluteRotationQuaternion and/or reassign rotationQuaternion or used physicsMesh or collisionMesh and copyFrom. Since I moved from using physics- and collisionMesh, I will get it by absoluteRotationQuaternion and reassign instead of copyFrom.