When using “Show Normals” from Debug tab when selected a Mesh in Inspector, Babylon crashes with following error msg
normalMaterial.ts:144 Uncaught TypeError: this._isReadyForSubMesh is not a function at NormalMaterial../normal/normalMaterial.ts.NormalMaterial.isReadyForSubMesh (normalMaterial.ts:144)
We are running Babylon v4.1 and it has been working fine both in v4.1 and v4.0.3.
But I think I know what the problem is ! Here it goes:
Inspector uses normalMaterial
from a preview version of Babylon (I’m guessing it’s 4.2-alpha): see line 151 in meshPropertyGridComponent.tsx
(full path is inspector/src/components/actionTabs/tabs/propertyGrids/meshes/meshPropertyGridComponent.tsx, cant post more than two links since I’m a new user).
normalMaterial
has a new update from 4 days ago which added a call to this._isReadyForSubMesh(submesh)
.
_isReadyForSubMesh
seems to be added on pushMaterial in 4.2-alpha however does not exist on pushMaterial in 4.1. I’m guessing the normalMaterial
from preview.babylonjs....
inherits from the pushMaterial
on the installed version of Babylon, and that’s the reason why it crashes with the error message above.
Unfortunately not reproducible in playground, (I’m guessing inspector for v 4.1 in playground does not use normalMaterial
from https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.js
)
If this is not a bug, or if my guess at whats happening is not right, please tell, I’m curious what is happening, I tried to figure it out when debugging. Really like the inspector by the way