1
$\begingroup$

I would like to bypass the linked objects in a "for" loop, but I wouldn't know what condition to use. I'd write something like this:

for o in bpy.context.scene:
    if o is ###"single user":
        print(o.name)

Linked object example: enter image description here

$\endgroup$
  • $\begingroup$ Do you mean whether an specific object has more than 1 user? $\endgroup$ – brockmann Aug 26 at 7:44
  • $\begingroup$ @brockmann, Yes, like to, if object have 1 or more copy linked $\endgroup$ – Pastrokkio Aug 26 at 14:18
  • 1
    $\begingroup$ Object.data.users returns the number of users $\endgroup$ – brockmann Aug 26 at 14:22
  • $\begingroup$ @brockmann ,I think this should be posted as an answer in order to earn points, that's exactly what I was looking for. Ty! $\endgroup$ – Pastrokkio Aug 26 at 18:18
2
$\begingroup$

Object.data.users returns the number of data-block users. Proof using the Console:

>>> for ob in bpy.context.scene.objects:
...     print ("Object name:", ob.name, "- Users:", ob.data.users)

Object name: Cube - Users: 1
Object name: Light - Users: 1
Object name: Camera - Users: 1
$\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.