I am new to
bpy and I am wondering why the values
material_index returns are all zeros.
This is the code I am using:
bpy.ops.object.select_all(action='SELECT') for obj in bpy.context.selected_objects: bpy.context.scene.objects.active = obj obj.select = True material_ids = set() if obj.data is not None and hasattr(obj.data, "polygons"): for polygon in obj.data.polygons: material_ids.add(polygon.material_index)
material_ids is a set that only contains
Thank you for your help!