I want dynamic id instead of static mesh id

You can assign an ID to your materials, the same way you do with a mesh.
It’s not a unique ID so different materials can have a same ID.
This way you can assign a texture to any material with this ID.
Would that cover your needs?

1 Like