If we need to find and select all objects in the scene whose UV-Map map name matches the specified one, we can do this using the Blender Python API.
First, let’s deselect all the objects in the scene:
1 2 |
for obj in bpy.data.objects: obj.select_set(False) |
To select the necessary objects, let’s loop through all the meshes of the scene:
1 2 |
for obj in bpy.data.objects: if obj.type == 'MESH': |
Loop through all the UV-Maps of each mesh and check if the UV-Map name matches the given one. If yes, select this object.
1 2 3 |
for uvmap in obj.data.uv_layers : if uvmap.name == 'UVMap': obj.select_set(True) |
Full code:
1 2 3 4 5 |
for obj in bpy.data.objects: if obj.type == 'MESH': for uvmap in obj.data.uv_layers : if uvmap.name == 'UVMap': obj.select_set(True) |
In this example, those meshes that have at least one UV-Map named “UVMap” will be selected.