I have made a new object for the Add > Mesh menu and I would like to unregister it but when I try to with:
if __name__ == "__main__":
unregister()
I get the following error:
Traceback (most recent call last):
File "\add_tetrahedron.py", line 63, in <module>
register()
File "\add_tetrahedron.py", line 59, in unregister
bpy.utils.unregister_class(OBJECT_OT_add_object)
RuntimeError: unregister_class(...):, missing bl_rna attribute from 'OrderedMeta' instance (may not be registered)
I've tried looking for this error but, I can't find what I'm doing wrong. I can't find anything about bl_rna anywhere.
I'm using Blender 2.79b
The register functions look like this:
# Registration
def add_object_button(self, context):
self.layout.operator(
OBJECT_OT_add_object.bl_idname,
text="Tetrahedron",
icon='PLUGIN')
def register():
bpy.utils.register_class(OBJECT_OT_add_object)
bpy.types.INFO_MT_mesh_add.append(add_object_button)
def unregister():
bpy.utils.unregister_class(OBJECT_OT_add_object)
bpy.types.INFO_MT_mesh_add.remove(add_object_button)
if __name__ == "__main__":
register()
register()
function works just fine. $\endgroup$