MeshBuilder.CreateDecal stopped working after upgrading to v6.8.0 (Instanced mesh?)

Hi everyone,

I think I upgraded from v6.3.0 (or so). Here is the code - which should not be doing anything out of the ordinary:

//FYI: all parameters console.logged; have expected type! 2nd parameter is a mesh; other params are Vector3s.
const decal = BABYLON.MeshBuilder.CreateDecal("decal", result.targets[i], {
  position: result.pickInfos[i].pickedPoint, 
  normal: result.pickInfos[i].getNormal(true), 
  size: this.effect.decalSize
 });             
break;

Unfortunately, I can only give you this error message since I have not figured out yet how to obtain a maxified version of Babylon:

Babylon.min.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'matrixData')
    at Object.ph [as CreateDecal] (Babylon.min.js:1:2001885)
    at DecalGroundBlootSplatPlayer.play (DecalGroundBlootSplat.js:86:51)
	(...)		

I cannot replicate the exact same error in the playground. But if you try to apply the decal on an InstancedMesh rather than a normal one it fails as well: https://playground.babylonjs.com/#1BAPRM#1346

Also note here: https://playground.babylonjs.com/#1BAPRM#1347. You cannot add a decal to the parent mesh anymore (on the right).

Best wishes
Joe

Thanks for reporting!

This PR will fix the crash:

Regarding the 2nd problem, it’s because the pick predicate does not check for “catMother”:

1 Like

Ugh, sorry. Totally did not see the predicate function.