Strangeness with ghost object datablocks

Hi Folks, not quite sure where to post this, so I put it here but admins feel free to move it to wherever you feel it should be.

I am working on a scene and in the process of giving my objects & meshes proper names and tidying up redundant stuff, I kept coming across objects which I couldn’t remove. If I list everything in the outliner, the objects in question do not show up.
The only time I can see them is if I choose ‘datablocks’ as the option at the top.

I ended up writing a small python script to try and figure out what is going on, frankly, whilst I learned some python, it hasn’t helped me any. :eek:

I have attached a blend file which shows the problem, whittled down from my full scene. The script in the text window ‘showweirdness’ will populate the console window with the list of the “errant” items, (all having a ‘.001’ suffix).

Now, assuming I have done the python correctly, all these items are allegedly in layers 8 and 18 and yet all my objects are actually in layers 1 & 2 and for the life of me, I cannot figure out how to kill this other data.

I was having similar problem with images / materials where I know they are not being used, but in the list they show ‘x’ users, but them at least, I managed to remove manually.

Any help most gratefully recieved.

I don’t see anything using your script

Add all the objects you want to keep to a new group and save your file to a new name
Change outliner to groups
For each group drag an object onto the viewport. In its Object / Group settings use ‘Unlink Group’. Repeat for all groups and you should have no groups left. Delete objects in the viewport
With the Orphan Cleanup addon, delete orphan meshes
Save your file and re-open it. 41 objects still showed up in the datablocks
With the orphan cleanup addon delete orphan objects
Save your file and reopen it. Now I had no objects showing up in the datablocks
Append the group your saved originally to get back the objects you want to still use

To be easier you could just start a new blend file and append the group you created at the start

The script was just something to run as a ‘utility’ thing, it pointed me to the iffy area at least.

Ahh, well, donkey work ahead then. Coming from a coding background I was hoping I could just be lazy and get a script to do it all. :stuck_out_tongue:

Seems when it comes to groups, any work on tidy up has to be done manually as they are still percieved as linked even though they may not be used, odd that, sure there is a reason behind the scenes I guess.
On the up side, finally dipped my toe in the Python waters. http://www.blenderartists.org/forum/images/smilies/sago/smile.gif

Ended up finding a whole host of unreachable node groups, geometry and shader groups, non existent objects. In the end, it seems the only answer to removeing them is to create groups of the “good stuff” and then import everything into a fresh Blender file. Bit of a faffy way to handle it, I can’t imagine it’s good for a blend file to have such rubbish lying around when it cannot be accessed, just a “gotcha” I will have to store for future use.

Edit: Ok, second way, run Orphan Cleanup many times and save & reload between each one, but it took quite a few goes, I’m guessing because of some inter-dependencies which mean one part has to go before the other becomes orphaned then can be removed and cleared on a reload. Not exactly a “one button” solution, but it at least means not having to reload everything into a new file. My thanks go to Richard and the author of the script, cotejrp1. :slight_smile: