Is there a way to select multiple meshes without looping, exported from Blender?

Greetings guys !

The header explains the question, but I will give example, to be more easy to understand the case.

Blender problem
As we all know when mesh in Blender is created it is given unique id if there are meshes with that same name for example we have mesh with name ‘Testing’ if we create 1 more mesh with that name second mesh will automatically be called ‘Testing.001’

Babylon problem
With example up, lets pretend i have 30 elements which are used for detect collisions. I need to to something like

mesh.getMeshesById('colliders');

But I can’t do that because blender make each element to be with unique id.
I have tried with tags, like this and after that tried to access it like that.

mesh.getMeshesByTags('colliders');

but it won’t work because tags added in picture which I posted are going into object metadata, and can be accesed like that

mesh.metadata.gltf.extras.tags

Which is not what I really want.

Any advice would be appreciated, thanks in advance !

After import the scene you can attach all tags like this:

scene.meshes
  .filter(mesh => !!mesh.metadata.gltf.extras.tags)
  .forEach(mesh => Tags.AddTagsTo(mesh, mesh.metadata.gltf.extras.tags));

Thanks once again mate, is there another non so computational dependand type of selecting multiple meshes in my case, because the map with which I am working is pretty big.

Did you measure time for this task? I dont know how many meshes you should have to get long time computation.
But you can try some optimization techniques, start from switch from “filter” and “forEach” to native for loop. And to coroutines which provides ability to separate computation by several frames.

Alright, will check and optimise than if there is a need for optimisation, thanks !