1
$\begingroup$

Is there a way via script to select only the single user objects in Blender 2.93?

I have tried to look into the bpy.ops.object.select_linked but this requieres having an object selected/active plus the fact I need to select the single users and not the linked ones.

$\endgroup$
4
$\begingroup$

Select all objects in scene where users is exactly 1.

import bpy

context = bpy.context
scene = context.scene

for ob in scene.objects:
    ob.select_set(ob.users == 1)

Similarly can look for objects that are single users of their data. An empty has None for data, Will assume each empty (not reference image) is a single user.

import bpy

context = bpy.context
scene = context.scene

for ob in scene.objects:
    ob.select_set(not ob.data or ob.data.users == 1)

Can also look at context.objects_in_mode_unique_data which i find of most use in edit mode.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.