ScriptSpot home

Forum topic · General Scripting

Material name

By titane357 · 2022-09-12

Description

Hi, I wanted to have the selected object name of the material ( multisubobject material ) with :
selection[1].material.materiallist[12] for eg.
but I get WOOD:Standart material for eg.

I just want "WOOD". Any help ? Thanks.

Comments (6)
miauu


-- this
selection[1].material.materiallist[12].name

-- or this:

str = "WOOD:Standart material"
(filterString str ":")[1]


Reply to miauu
titane357

Hi, thank you very much !
the first one will be my choice.
the second one is so cool !
:-)

Reply to titane357
miauu

.

The second one should be:


str = selection[1].material.materiallist[12]
(filterString str ":")[1]
Reply to titane357
miauu

Yeah. :) It was not for you. I had to type it properly in my first comment.