automatically create Material with layer's name

Hi, I'm looking for a script which automatically create and assign a Material with the name of the layer.

I've looking for this script on this site and on google but never find it.
I found one which creates automatically new material but I'm too bad to update it.
If it already exist i'm sorry for this request. (maybe a link ?)

That's for exporting an FBX to Substance painter with nice material renamed correctly.
Sorry for my poor english... and thank a lot for your support!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
id_ivan's picture

-

or
for o in selection do o.material = StandardMaterial name:o.name

Rivanoor Bren
https://rivanoor.info

dijiroro's picture

Solution

Hi myself !
I find this solution which works nice.

for i = 1 to selection.count do
(
newmat = StandardMaterial()

newmat.name = (selection[i].name)
selection[i].material = newmat

)

AttachmentSize
ajoutermtlrenomme.ms 146 bytes

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.