I want to select all meshes which a transparent material (e.g. glass) has been applied, when using Cycles (if it matters at all)? I just know how to select meshes with any kind of material applied to them as follow:
bpy.ops.object.select_all(action='DESELECT')
for obj in bpy.data.objects:
if obj.type == 'MESH':
for slot in obj.material_slots:
if slot.material:
obj.select = True
How can I instead only select meshes with transparent materials? You can also work with nodes. In that case, you may want to download this object that I'm currently using and need to select its transparent meshes. If you want to use the mesh I am providing, select Cycles renderer first and then load the mesh you will get something like this in the node editor: