What do I do if I want to get the name of the Material (a string) assigned to given object?
I have tried to use getMaterials() but that seems to output a list holding no elements.
Can anyone please help me?
Koba
What do I do if I want to get the name of the Material (a string) assigned to given object?
I have tried to use getMaterials() but that seems to output a list holding no elements.
Can anyone please help me?
Koba
In 2.32 You can try this:
Mesh = Object.getData()
MatList = Mesh.materials
Hope that helps.
Doc
Thanks!
mesh.materials will be a list- if you want the name as a string youll need to pick a material and then get the name
ie
mesh = Object.getData()
for mat in mesh.amterials:
print mat.getName()