Notifications
Clear all

[Closed] Rename Multi/Sub-Object Materials

I’m creating a script that takes an object material from the viewport and creates on the material editor the specified number of copies with random color properties then distribute it to any number of copies.

 The problem is when I try to rename the Sub materials on each slot.

If you see the mat_problem.jpgyou can see that I can correctly rename the main material name, but the sub materials they keep adding the previous number and adding one more, so by material 24 I have add it 24 numbers

Does anyone have any idea how to rename sub materials, perhaps just adding to the original name of the sub material the main material name.

 Thanks in advance.

Guillermo M Leal LLaguno

1 Reply

Just check, in the naming somewhere you must have a variable that already contains the previous number while naming the sub-material. If you can send your code, I can see if I can help,

Regards,
Vikram