set Material?

Hi !

how do i set a metrial in python !?

i just get it work with the texture channel (texture= pure color), but there must be a way to do it easily.

so e.g. i got 3 materials and a mesh object and want to change the material using python !

PLZ Help !

what I do (and works for me) is:

obj = Blender.Object.Get('NameOfObject')

if obj.getType() == 'Mesh':
    msh = obj.getData(False)
    mat = Blender.Material.Get('NameOfMaterial')  #or create new and tweaks settings

I’m in a hurry, so maybe some calls are misspelled, but the general sense is clear and you can always refer to the API doc.
Hope this helps

thanxx i´m tryin with this :

    me = NMesh.GetRaw("Arm")
    mat = me.materials[1]  

but here i have to put the color in!

will try your version