Use of name parameter in meshes

I am curious regarding the use and foreseen purpose of the name parameter for meshes, as used in, say, a function call to MeshBuilder.CreateBox.

Does it have any internal significance? As in, is there any danger (besides being dull) if I just name 1000 boxes 'bob'?

At this stage, I see it as a useful mechanism for identifying individual meshes and even groups of meshes (e.g., for some event handling). I suppose a clever naming strategy could also introduce namespaces – something like CSS classes. Interestingly, we could also change these at run-time. So I see a lot of potential there too. But I’m also wondering if the internal API depends on name uniqueness in any way, or if there are any plans for its use in some way. Finally, if there are any clever use-cases in existence, please let me know.

I see its use in animation functions via: getAnimationGroupByName . So I’m currently thinking of this as a selecting mechanism, and if I decide to have 1000 'bob' boxes, then I’d have no specificity for animating them individually via this mechanism.

Hey @Babylonian2718,

Yeah you’re instincts are correct. The name is there for you as a developer to be able to easily “label” and access meshes in a number of ways throughout the system.

The name of a mesh is useful in a number of different areas, but it’s entirely there to make your life easier and help you organize your babylon scene.

Hope this helps a bit.

1 Like

Awesome. Thank you.