5
$\begingroup$

I find it difficult to understand that there are two users of that mesh data in my blend file.

How can I clearly track the user of a block of data in Blender?

enter image description here

$\endgroup$

2 Answers 2

3
$\begingroup$

First, deselect all.

You can then select all users of (eg) a mesh by right clicking that mesh in the outliner then clicking "select linked":

enter image description here

It should work with any linked item as materials, etc.

Then if you switch the outliner to "selected", it will list just all linked users.

enter image description here

bring now able to look at your file, it seams really weird...

you have 1 scene, and bender reports 1 object, but in the datablocks you have 188 objects... how many should it have in your goal?

enter image description here

and you "only" object has currently one of dozen other meshes...

enter image description here

could it be that this file has issues due to a "troubled" history..?

I tried appending only this object from your file (all 188 objects are still there) to a blank new file, and it works well now, and its mesh has only 1 real user, as it should have been...

enter image description here

$\endgroup$
9
  • $\begingroup$ Thanks for the reply. But that doesn't work for my files. Only one object in my scene is still selected. I have attached a blend file for you. Please check my file. $\endgroup$ Commented Nov 8, 2017 at 12:25
  • 1
    $\begingroup$ I updated my answer... $\endgroup$
    – m.ardito
    Commented Nov 8, 2017 at 12:53
  • $\begingroup$ OMG...Yes I did a lot of work in this scene. But I knew that Blender would delete the data it did not use when closing the file. Why dose the blend file has leftover residue data? What habits do I have to prevent this from happening? $\endgroup$ Commented Nov 8, 2017 at 13:14
  • 1
    $\begingroup$ I tried appending objects from your file into a blank new file, it works, objects are all still there... you could do the same, either import in the new file only what you need, or as they are many, import a bunch of them and delete what should be gone. Then import others, and continue until your new file is OK. $\endgroup$
    – m.ardito
    Commented Nov 8, 2017 at 13:33
  • $\begingroup$ updated answer again $\endgroup$
    – m.ardito
    Commented Nov 8, 2017 at 13:38
3
$\begingroup$

Via a script.

Re-visiting https://blender.stackexchange.com/a/230425/15543 which was written to see which material data-block used which images.

An image, like a mesh, world, material ... in blender is an ID object. Given the image is our ID object of interest Run over all the ID objects in the blend and list and report any where ob.user_of_id(ID) is > 0

Copy and paste the script block below into the text editor and run it. Output is written to the system console:

import bpy
from bpy.types import bpy_prop_collection

    
def search(ID):
    def users(col):
        ret =  tuple(repr(o) for o in col if o.user_of_id(ID))
        return ret if ret else None
    return filter(None, (
        users(getattr(bpy.data, p)) 
        for p in  dir(bpy.data) 
        if isinstance(
                getattr(bpy.data, p, None), 
                bpy_prop_collection
                )                
        )
        )
        

img = bpy.data.images[0] 
#img = bpy.data.images['Foo'] # an image named Foo

# report
print(repr(img))
print("Users:", img.users)         
for users in search(img):
    print(users)

Test run. Image used in material, "Material", node group "NodeGroup", reference image empty "Empty", texture "Texture" and world "World".

bpy.data.images['Screenshot from 2021-06-17 17-17-47.png']
Users: 5
("bpy.data.materials['Material']",)
("bpy.data.node_groups['NodeGroup']",)
("bpy.data.objects['Empty']",)
("bpy.data.textures['Texture']",)
("bpy.data.worlds['World']",)

Or for an Object type

.. or users of context object, edit to img = bpy.context.object

result

bpy.data.objects['Cube']
Users: 2
("bpy.data.collections['Collection 1']",)
("bpy.data.scenes['Scene']",)

How to find out what is using an image in a blend file

How to find the users of a material?

How do I find which materials are using a particular node group

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .