I have a python script that (amongst other things) is supposed to delete objects. Currently I am unlinking the object but when I want to create objects later in the script with the same name as the deleted it is automatically named name.001 and so on. Is there a way to completely delete objects using a script?
bpy.data.objects.remove(bpy.context.scene.objects[id], do_unlink = True)
This should remove unlink the object from every scene you have. After that, the creation of a new object should go without the namechange.