Colbits equivalent in 2.5?

Hi All,

I am looking for a way to assign a material to an object, NOT the mesh. In 2.49 you could set the color bits to achieve this. I scanned through the API pdf and could not find an immediate way to do this, although it is available in the GUI.

Does anyone have any example code?

Thanks!

Huh,

What do know, after digging around in materials slots and following the IDE tooltip I came up with…

bpy.data.objects["Cube"]materials_slots[0].link= "OBJECT"

You can assign the upper case string to be “OBJECT” or “DATA”.