0
$\begingroup$

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

import bpy
path = "/Users/Rakesh\Desktop/wallpapers/FIRE SHADER/Fire Shader Advanced.blend\\Material\\"
material_name = "domain"
bpy.ops.wm.append(filename=material_name,directory=path)

and now what I want is that this appended material should become the active material in the material slot list and it should replace the default material already present there.

Can any one help me out on that?

$\endgroup$
  • $\begingroup$ 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? $\endgroup$ – brockmann Sep 27 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.