How to read color of faces

i saw a way to write the color to faces to a selected fobject

but how do you read the color of faces - the R G B values
for each face?

Thanks

Try


def get_face_color(me, face): 
    return me.materials[face.mat].getRGBCol()

.

Here’s a small example how to use it to print out colors of all faces of the given mesh:


from Blender import Material, Mesh, Window 
 
def get_face_color(me, face): 
    return me.materials[face.mat].getRGBCol() 
 
# exit edit mode so that we operate on correct data! 
is_editmode = Window.EditMode() 
if is_editmode: Window.EditMode(0) 
 
me = Mesh.Get("Suzanne") # just get some mesh here

for face in me.faces:
    print get_face_color(me, face) 
 
# restore edit mode 
if is_editmode: Window.EditMode(1)

i’’ work this week a little on this and see how to read theses faces color

hopefullly you can get all the other parameters the same way

i got example PDF chowing how to write parameters to the faces

don’t know if there is a list of name for all the parameters like shade refelction specular

ect…

Thanks

In previous code me.materials[face.mat] gives you the material. Check out http://www.blender.org/documentation/248PythonDoc/Material.Material-class.html to see what to do with it.