In order to select all objects in the scene whose name starts with a certain prefix (a certain set of characters), we can use a very simple script.
We can get a list of all objects in the scene through the following list:
|
1 2 3 |
bpy.context.scene.objects # [bpy.data.objects['high_Suzanne'], bpy.data.objects['high_Suzanne.001'], ...] |
For example, we need to select all high-poly objects whose names start with the prefix “high_”.
Let’s walk through all the objects in a loop and if the object’s name starts with a pre-defined prefix, we will select it.
|
1 2 3 4 5 6 7 |
prefix = 'high_' for obj in bpy.context.scene.objects: if obj.name.startswith(prefix): obj.select_set(True) else: obj.select_set(False) |
If the object’s name starts with a prefix, we use the select_set() method to make it selected.
In the “else” block, we deselect all other objects whose name does not match the condition.

.blend file on Patreon