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!


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 | |

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.