# How to append a material and make it the active material using python?

I have appended a material from another file using the following script:

import bpy

• You can get the active material (selected slot in the material list) using C.object.active_material_index and you can assign to any slot (via index operator) using something like C.object.material_slots[0].material = my_material. If you don't know what C is, open up the blender console window. Also, to append a material properly see this answer. This is what you want right? – brockmann Sep 27 at 8:15