0
$\begingroup$

I have an object named "Paper_obj"

enter image description here

enter image description here

After entering the Material tab, there are tons of materials within, "White Transmission", "Steel Mag", etc.

My main purpose is to change the "PaperTopYellow" to "PaperTopRed" by clicking on the drop down list. Can it be done with Python? enter image description here

enter image description here

Since there are many other objects in the blend file, the hardest part for me is to first target that "Paper_obj" first and then change the "PaperTopYellow" to "PaperTopRed" within.

Thank you!

$\endgroup$
0
$\begingroup$
bpy.data.objects['Paper_obj'].data.materials[3] = bpy.data.materials['PaperTopRed']

The above should be the general answer.

However, what if I do not want to use the slot number but would like to target "PaperTopYellow" and replace it with "PaperTopRed"?

Sometimes, the slot number for "PaperTopYellow" may not be 3 but 2 instead.

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.