Vertex Group from Material Slot - or how to store Material slot for later use

Hi,

is there an easy way to get different vertex groups from the material slots of an object.

I have a lot of assets where I need to remove the materials but I want to keep the selections in order to texture them later again.

My idea is to store the selections as vertex maps.

Or is there even a smarter way to do?

Many thanks!

If you don’t quit blender, there is no obvious reason to do that.

You can remove or mute texture from material, without removing material.
You can also remove material without deleting material slot.

If you have to remove material slots, you can store material index as a Face attribute of mesh with Integer data Type, instead of multiple vertex groups.

If you need to export to another software, you may store equivalent of material index as any kind of attribute supported by it and export format.

Thanks for your reply.

“If you have to remove material slots, you can store material index as a Face attribute of mesh with Integer data Type, instead of multiple vertex groups.”

How would you do that?

When you assign different materials to to different faces, a material_index attribute is automatically created.
It is automatically removed when you suppress the slots.
You just have to rename it, for example, to mat_index to avoid its deletion ; when you delete the material slots.
Then, when you recreate material slots ; you just have to rename mat_index to material_index to reassign new materials slots to same faces used by old ones.

Ok thanks!