From 0dad04903bdb39ff845a7452415a248d99f60ffa Mon Sep 17 00:00:00 2001
From: Campbell Barton <ideasman42@gmail.com>
Date: Fri, 11 Feb 2011 03:40:27 +0000
Subject: [PATCH] all modules now register and unregister without errors.

---
 development_icon_get.py         | 4 ++--
 rigify/metarig_menu.py          | 1 -
 rigify/ui.py                    | 8 ++++----
 space_view3d_copy_attributes.py | 2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/development_icon_get.py b/development_icon_get.py
index 6f052b055..f5267e254 100644
--- a/development_icon_get.py
+++ b/development_icon_get.py
@@ -248,8 +248,8 @@ def unregister():
         pass
     if __name__ == "__main__":
         # unregistering is only done automatically when run as add-on
-        bpy.types.unregister(OBJECT_PT_icons)
-        bpy.types.unregister(CONSOLE_HT_icons)
+        bpy.utils.unregister_class(OBJECT_PT_icons)
+        bpy.utils.unregister_class(CONSOLE_HT_icons)
 
     bpy.utils.unregister_module(__name__)
 
diff --git a/rigify/metarig_menu.py b/rigify/metarig_menu.py
index 828708d06..56b82370a 100644
--- a/rigify/metarig_menu.py
+++ b/rigify/metarig_menu.py
@@ -54,6 +54,5 @@ def register():
 def unregister():
     bpy.utils.unregister_class(AddHuman)
 
-    #bpy.types.unregister(AddHuman)
     bpy.types.INFO_MT_armature_add.remove(menu_func)
 
diff --git a/rigify/ui.py b/rigify/ui.py
index 09257f596..4c3353bb3 100644
--- a/rigify/ui.py
+++ b/rigify/ui.py
@@ -242,7 +242,7 @@ def register():
 
 
 def unregister():
-    bpy.types.unregister(DATA_PT_rigify_buttons)
-    bpy.types.unregister(BONE_PT_rigify_buttons)
-    bpy.types.unregister(Generate)
-    bpy.types.unregister(Sample)
+    bpy.utils.unregister_class(DATA_PT_rigify_buttons)
+    bpy.utils.unregister_class(BONE_PT_rigify_buttons)
+    bpy.utils.unregister_class(Generate)
+    bpy.utils.unregister_class(Sample)
diff --git a/space_view3d_copy_attributes.py b/space_view3d_copy_attributes.py
index 4c1babb10..8b622c3d9 100644
--- a/space_view3d_copy_attributes.py
+++ b/space_view3d_copy_attributes.py
@@ -765,7 +765,7 @@ def unregister():
             item.idname = 'pose.copy'
             break
     for menu in _layer_menus:
-        bpy.types.unregister(menu)
+        bpy.utils.unregister_class(menu)
     bpy.types.DATA_PT_texface.remove(_add_tface_buttons)
     km = bpy.context.window_manager.keyconfigs.active.keymaps['Mesh']
     for kmi in km.items:
-- 
GitLab