Unlinking an object from all collections seems to automatically destroy it. Try: [m.name for m in bpy.data.meshes if m.users == 0] to list all orphaned meshes.
Thanks for the response. It does help me access the orphan data.
Just one thing, is there a way to recall the previous translation and rotation values of the orphan mesh? Currently, when I relink it again, it snaps back to the world origin.
Here is my working code:
import bpy
orphan_list = [m for m in bpy.data.meshes if m.users == 0]
col = bpy.data.collections[0]
for orphan in orphan_list:
object = bpy.data.objects.new(orphan.name, orphan)
col.objects.link(object)
As far as I’m aware, objects store transformation information, not meshes. So if you delete objects, you also delete the information required to translate and rotate.
@ambi
Just to confirm. So there’s no way to retrieve them once deleted?
Or are there any other method of deleting an object and retain its transformation?