Hi guys,
sorry for a noob question. How can I learn if a mesh has the second UV channel? Is there a method inside Babylon to define if a mesh has the second UV channel or get a list of UV channels in a mesh?
Thank you
Hi guys,
sorry for a noob question. How can I learn if a mesh has the second UV channel? Is there a method inside Babylon to define if a mesh has the second UV channel or get a list of UV channels in a mesh?
Thank you
You can use mesh.isVerticesDataPresent(VertexBuffer.UV2Kind) to know if the mesh has this attribute data setup
Thank you for a quick answer, unfortunately this throws an error that VertexBuffer is not defined. The editor then added the following line automatically:
const { VertexBuffer } = require(“babylonjs”);
But then the console throws another error that require is not defined.
What am I doing wrong?
so use mesh.isVerticesDataPresent(“uv2”)
If you’re writing vanilla browser javascript, you should be able to use BABYLON.VertexBuffer.UV2Kind like on the playground. 
https://playground.babylonjs.com/#7QQ3M5#2
Yeah, thanks! That worked for me!