What I’d like to do is delete an object from the current scene and memory.
What I found is do ‘unlink’ the object from the scene, but it seems it 'unlink’s from the scene but not delete from the memory.
Any help woud be appreciated.
correct, you unlink the object
the object will not be saved with the file, and if you quit and load the file it will be gone. all datablocks work this way
Thanks, but, is there any way to delete the object from the current scene without “quit and load the file”?
A save and reload should do it. No need to quit.
Sorry, but what I meant is unlink objects during runtime.
What I have is, I have a python GUI which a button that creates objects.
But what I need is a button that deletes the objects that I just created.
Thanks 
scn.unlink(ob)
Window.RedrawAl()
should do it.
Hi,
I also need to unlink objects from the scene: mesh and armature. As far as I understood when I unlink it from the scene, the actual object is still hanging around, therefore the more I unlink and create new objects the more memory is being occupied. Window.RedrawAll() effects only the displaying of objects, but not their actual storage. Is there any way to get rid of those unlinked objects? Is “save and load” the only solution?
Thank you.
And also is it possible to invoke the “BAKE” from within the script with new BPython API?
Thanks.
You need to get your terminology right…
Datablock- A Chunk of data- Scene/Object/Group/Image/Mesh/Screen…
Object - Linked to scene, Referendes obdata.
ObjectData/ObData - Objects link to this - Armature/Mesh/Curve etc.
Blender keeps track of how many users each datablock has.
so the closest you can get to removing is to unlink.
Blender has radiosity bake access from the API… Have a look at the API docs hosted from my site…
Thank you for the explanation!
However, I wasn’t able to find the Bake function in the Scene.Radio. Did i look the right place?