so im having problems trying to delete objects with python. sorry for this being a noob question. so i found this other thread that someone posted an example script. i copied but it had like 8 errors when i tried to use it. then i corrected it to this.
import bpy
obj = bpy.data.objects['Plane']
scene = bpy.data.scenes[0]
bpy.ops.object.select_all(action='DESELECT')
obj.select = True
scene.objects.active = obj
for i in range(len(obj.material_slots)):
obj.active_material_index = i - 1
bpy.ops.object.material_slot_remove()
bpy.ops.object.parent_clear(type='CLEAR')
bpy.data.objects.remove(obj)
when i do that it says the plane must have 0 objects to be removed, but it has 1. i have no idea what that means. could someone help me please?