Group meshes by mesh name to call in blueprint

Hey,

Background
I’m in a project where we use 150+ meshes which together assembles as a vehicle, to be used as a product visualization. The 150-meshes are divided into about 15 different pre-decided category based on materials, for example glass, metal, rubber and so on. Which category a mesh belongs to depends on the mesh name like “vehicle_window_glass”, which belongs to the category glass.

Requirement
In the project the meshes must be replaceable, but the mesh names are known and looks like the one above. This means we can’t assign any material or preferences to the meshes manually in the editor, but everything must be executed in Blueprint on Begin Play or Construct. (Simplified) We have for example solved the Assign Material with a loop which checks if a Mesh Name-sting contains a Category-string, and dependent on the result assign the correct material.
In other Blueprints, separated form the “Assign Material”, we want to call all the meshes in one category and it would nice not to use the loop-technique every time.

The Question
What we are looking for is a way to, in Blueprint, check all meshes imported into the world and in some way group them into the different pre-defined category’s based on mesh name, store them in a variable or equivalent, so we can call this group-variable in different Blueprints.

What we’ve thought of but not solved:

  • To create a Master Matrix where every row acts as one category
  • Some kind of database
  • Using tags

We know it’s a unusual way to use UE, so if something is incomprehensibly just ask and we’ll answer.