1
$\begingroup$

Is there a way, to check if the current object is using no material for cycles engine, so that the code could take a logical decision based on that!

$\endgroup$
2
$\begingroup$

Get all the materials

materials = bpy.context.active_object.data.materials

Count the material slots

nMat = len(materials)

Check if a material slot is empty (in this case, the first slot)

isEmpty = not materials[0]
| improve this answer | |
$\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.