How to select meshes with transparent materials applied to them only? 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:
Generally determining if a given node setup is transparent is rather tricky; for instance, a material may be transparent only in some areas (textured transparency) and other such complications. However, in your case, it seems that checking if the value of the "Mix Color/Alpha" node is &lt; 1 should be sufficient.

for obj in bpy.data.objects:
    if obj.type == 'MESH':
        for slot in obj.material_slots:
            if slot.material:
                mat = slot.material
                for node in mat.node_tree.nodes:
                    if node.label == "Mix Color/Alpha":
                        if node.inputs[1].default_value[0] &lt; 1:
                            print("Material '%s' on object '%s' seems transparent" % (mat.name, obj.name))


The importer seems to create both cycles and BI materials, so you could also check the BI material property (even while cycles is active):

for obj in bpy.data.objects:
    if obj.type == 'MESH':
        for slot in obj.material_slots:
            if slot.material:
                mat = slot.material
                if mat.use_transparency:
                    print("Material '%s' on object '%s' seems transparent" % (mat.name, obj.name))