TypeError using mesh.serialize()

Heya,
An issue popped up while using the mesh.serialize() function:
image

I’m using the mesh.serialize() → Mesh.Parse() method to copy a mesh from one scene to another.

I’ve reproduced the error at:

The file is big so it might take a while to load; but once the playground is ready, hit the “Export” Button to export start the export process.
The process will just fail with the error popping up in the console.

Any idea what’s up?

serialize takes an object in parameter: https://playground.babylonjs.com/#YE5K3X#5

1 Like

Oh right I see what’s going on;

I’m using typescript and I was using “AbstractMesh” rather than “Mesh”. This meant I was also taking in to account TransformNode’s serialize() type definition which has an optional parameter;

Is the inconsistency between TransformNode and Mesh’s serialize() normal?

Thanks!

I changed it here WebGPU fix PCF shadows by sebavan · Pull Request #13105 · BabylonJS/Babylon.js · GitHub

1 Like