“remove” doesn’t seem to work for me (tested in 2.82 / 2.83 /2.9)
More and more copies are created when I run the script. Did I forget something?
python template: addon_add_object.py
# Registration
def add_object_button(self, context):
self.layout.operator(OBJECT_OT_add_object.bl_idname,text="Add Object",icon='PLUGIN')
def register():
bpy.types.VIEW3D_MT_mesh_add.append(add_object_button)
def unregister():
bpy.types.VIEW3D_MT_mesh_add.remove(add_object_button)