Accessibility - Instanced Mesh causes exception


If you call BABYLON.Accessibility.HTMLTwinRenderer.Render then add an instanced mesh using Mesh.clone, an exception occurs while trying to look for the source mesh.
Kinda confusing because how would there be no source mesh when I used Mesh.clone?

Playground reproduction:



Welcome aboard!

cc @carolhmj.

The problem is that the onNewMeshAddedObservable observable is notified in the AbstractMesh constructor, so the InstancedMesh constructor has not been run yet, and the sourceMesh property is still undefined at that time.

I tried a fix:

Thanks for the fix! Happily waiting for the patch!

1 Like