Default Mesh Instance Naming Format Question?

Right now if you clone a mesh it adds a period and writes the name twice for the unique id.

So, if a mesh is named “a”,
the cloned mesh looks like “.a.a”

Why the doubling up of the name, instead of it just being .a?
I was debating changing that behavior in my build, but I figure I should ask why the Babylon gods did that, as I am sure there is a good reason.

Good reason for naming meshes? I am not sure there was any deep thought behind it. The mesh’s name doesnt really matter to the framework, it is not used in any way other than to filter meshes.

Having said that, I am not sure where exactly this happens? The clone function of a mesh looks like this:

public clone(name: string = "", newParent: Nullable<Node> = null, doNotCloneChildren?: boolean, clonePhysicsImpostor: boolean = true): Mesh {
        return new Mesh(name, this.getScene(), newParent, this, doNotCloneChildren, clonePhysicsImpostor);

It seems like the default name is none at all.

1 Like