Calling clearCachedData on a transparent mesh will cause an error

At runtime, calling clearCachedData on a transparent mesh will cause an error.

https://playground.babylonjs.com/#9VSO12

The reason is that

geometry.getTotalIndices return 0, after calling geometry.clearCachedData,

so the subMehs.IsGlobal of subMesh changes before and after calling clearCachedData

This in turn causes subMesh.getBoundingInfo to return this._boundingInfo as undefined.

Thanks for reporting, this PR will fix the problem:

1 Like