patch [#25809] Auto-Registration as utility function.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 10 Feb 2011 23:48:22 +0000 (23:48 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 10 Feb 2011 23:48:22 +0000 (23:48 +0000)
This removes auto-registration, committed by Martin r30961.
Realize this is a contentious topic but Brecht and myself both would rather opt-in registration.

TODO:
- addons need updating.
- class list will be modified to use weakrefs (should have been done for existing system too).
- will move bpy.types.(un)register functions into bpy.utils.(un)register_class, currently including these functions in a type list is internally ugly, scripts which loop over types also need to check for these.

62 files changed:
release/scripts/io/netrender/ui.py
release/scripts/modules/bpy/utils.py
release/scripts/modules/bpy_types.py
release/scripts/op/animsys_update.py
release/scripts/op/fcurve_euler_filter.py
release/scripts/op/image.py
release/scripts/op/mesh.py
release/scripts/op/nla.py
release/scripts/op/object.py
release/scripts/op/object_align.py
release/scripts/op/object_randomize_transform.py
release/scripts/op/presets.py
release/scripts/op/screen_play_rendered_anim.py
release/scripts/op/sequencer.py
release/scripts/op/uv.py
release/scripts/op/uvcalc_follow_active.py
release/scripts/op/uvcalc_smart_project.py
release/scripts/op/vertexpaint_dirt.py
release/scripts/op/wm.py
release/scripts/ui/properties_animviz.py
release/scripts/ui/properties_data_armature.py
release/scripts/ui/properties_data_bone.py
release/scripts/ui/properties_data_camera.py
release/scripts/ui/properties_data_curve.py
release/scripts/ui/properties_data_empty.py
release/scripts/ui/properties_data_lamp.py
release/scripts/ui/properties_data_lattice.py
release/scripts/ui/properties_data_mesh.py
release/scripts/ui/properties_data_metaball.py
release/scripts/ui/properties_data_modifier.py
release/scripts/ui/properties_game.py
release/scripts/ui/properties_material.py
release/scripts/ui/properties_object.py
release/scripts/ui/properties_object_constraint.py
release/scripts/ui/properties_particle.py
release/scripts/ui/properties_physics_cloth.py
release/scripts/ui/properties_physics_common.py
release/scripts/ui/properties_physics_field.py
release/scripts/ui/properties_physics_fluid.py
release/scripts/ui/properties_physics_smoke.py
release/scripts/ui/properties_physics_softbody.py
release/scripts/ui/properties_render.py
release/scripts/ui/properties_scene.py
release/scripts/ui/properties_texture.py
release/scripts/ui/properties_world.py
release/scripts/ui/space_console.py
release/scripts/ui/space_dopesheet.py
release/scripts/ui/space_filebrowser.py
release/scripts/ui/space_graph.py
release/scripts/ui/space_image.py
release/scripts/ui/space_info.py
release/scripts/ui/space_logic.py
release/scripts/ui/space_nla.py
release/scripts/ui/space_node.py
release/scripts/ui/space_outliner.py
release/scripts/ui/space_sequencer.py
release/scripts/ui/space_text.py
release/scripts/ui/space_time.py
release/scripts/ui/space_userpref.py
release/scripts/ui/space_userpref_keymap.py
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py

index 0581e054dff4829fd8e3ea8c71ce4e97b7990807..1583dee427f103fd00c8b0b89e15a317582cee78 100644 (file)
@@ -363,16 +363,21 @@ class RENDER_PT_network_output(NeedValidAddress, NetRenderButtonsPanel, bpy.type
     
     draw = properties_render.RENDER_PT_output.draw
 
-class NetRenderSettings(bpy.types.IDPropertyGroup):
-    pass
 
-class NetRenderSlave(bpy.types.IDPropertyGroup):
-    pass
+def addProperties():
+    class NetRenderSettings(bpy.types.IDPropertyGroup):
+        pass
 
-class NetRenderJob(bpy.types.IDPropertyGroup):
-    pass
+    class NetRenderSlave(bpy.types.IDPropertyGroup):
+        pass
+
+    class NetRenderJob(bpy.types.IDPropertyGroup):
+        pass
+
+    bpy.types.register(NetRenderSettings)
+    bpy.types.register(NetRenderSlave)
+    bpy.types.register(NetRenderJob)
 
-def addProperties():
     from bpy.props import PointerProperty, StringProperty, BoolProperty, EnumProperty, IntProperty, CollectionProperty
     bpy.types.Scene.network_render = PointerProperty(type=NetRenderSettings, name="Network Render", description="Network Render Settings")
     
index f83b5ab01e06a3d948ea83354de6bac610885966..9d7b1fe342057b10dcf2218c93c0a963205ec86a 100644 (file)
@@ -100,9 +100,6 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
     import traceback
     import time
 
-    # must be set back to True on exits
-    _bpy_types._register_immediate = False
-
     t_main = time.time()
 
     loaded_modules = set()
@@ -112,7 +109,6 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
 
     if reload_scripts:
         _bpy_types.TypeMap.clear()
-        _bpy_types.PropertiesMap.clear()
 
         # just unload, dont change user defaults, this means we can sync to reload.
         # note that they will only actually reload of the modification time changes.
@@ -121,7 +117,6 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
             addon_disable(module_name, default_set=False)
 
     def register_module_call(mod):
-        _bpy_types._register_module(mod.__name__)
         register = getattr(mod, "register", None)
         if register:
             try:
@@ -132,7 +127,6 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
             print("\nWarning! '%s' has no register function, this is now a requirement for registerable scripts." % mod.__file__)
 
     def unregister_module_call(mod):
-        _bpy_types._unregister_module(mod.__name__)
         unregister = getattr(mod, "unregister", None)
         if unregister:
             try:
@@ -199,8 +193,6 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
                 for mod in modules_from_path(path, loaded_modules):
                     test_register(mod)
 
-    _bpy_types._register_immediate = True
-
     # deal with addons seperately
     addon_reset_all(reload_scripts)
 
@@ -367,12 +359,9 @@ def addon_enable(module_name, default_set=True):
     import bpy_types as _bpy_types
     import imp
 
-    _bpy_types._register_immediate = False
-
     def handle_error():
         import traceback
         traceback.print_exc()
-        _bpy_types._register_immediate = True
 
     # reload if the mtime changes
     mod = sys.modules.get(module_name)
@@ -402,19 +391,13 @@ def addon_enable(module_name, default_set=True):
         return None
 
     # 2) try register collected modules
-    try:
-        _bpy_types._register_module(module_name)
-    except:
-        handle_error()
-        del sys.modules[module_name]
-        return None
+    # removed, addons need to handle own registration now.
 
     # 3) try run the modules register function
     try:
         mod.register()
     except:
         handle_error()
-        _bpy_types._unregister_module(module_name)
         del sys.modules[module_name]
         return None
 
@@ -426,8 +409,6 @@ def addon_enable(module_name, default_set=True):
             ext = _bpy.context.user_preferences.addons.new()
             ext.module = module_name
 
-    _bpy_types._register_immediate = True
-
     mod.__addon_enabled__ = True
 
     if _bpy.app.debug:
@@ -454,7 +435,6 @@ def addon_disable(module_name, default_set=True):
         mod.__addon_enabled__ = False
 
         try:
-            _bpy_types._unregister_module(module_name, free=False)  # dont free because we may want to enable again.
             mod.unregister()
         except:
             traceback.print_exc()
@@ -594,3 +574,42 @@ def user_resource(type, path="", create=False):
                 target_path = ""
 
     return target_path
+
+
+_register_types = _bpy.types.Panel, _bpy.types.Operator, _bpy.types.Menu, _bpy.types.Header, _bpy.types.RenderEngine
+
+
+def register_module(module):
+    import traceback
+    total = 0
+    register = _bpy.types.register
+    for cls, path, line in _bpy_types.TypeMap.get(module, ()):
+        if not "bl_rna" in cls.__dict__:
+            total += 1
+            try:
+                register(cls)
+            except:
+                print("bpy.utils.register_module(): failed to registering class '%s.%s'" % (cls.__module__, cls.__name__))
+                print("\t", path, "line", line)
+                traceback.print_exc()
+
+    if total == 0:
+        raise Exception("register_module(%r): defines no classes" % module)
+
+
+def unregister_module(module):
+    import traceback
+    unregister = _bpy.types.unregister
+    total = 0
+    for cls, path, line in _bpy_types.TypeMap.get(module, ()):
+        if "bl_rna" in cls.__dict__:
+            total += 1
+            try:
+                unregister(cls)
+            except:
+                print("bpy.utils.unregister_module(): failed to unregistering class '%s.%s'" % (cls.__module__, cls.__name__))
+                print("\t", path, "line", line)
+                traceback.print_exc()
+
+    if total == 0:
+        raise Exception("unregister_module(%r): defines no classes" % module)
index 1cb30765bf013603bdaa1f6c81f292fba4a40974..43bd3f4ff26482d92fdbd7637e4d5794c71add6e 100644 (file)
@@ -550,85 +550,33 @@ class Text(bpy_types.ID):
         import bpy
         return tuple(obj for obj in bpy.data.objects if self in [cont.text for cont in obj.game.controllers if cont.type == 'PYTHON'])
 
-import collections
-
+# values are module: [(cls, path, line), ...]
 TypeMap = {}
-# Properties (IDPropertyGroup) are different from types because they need to be registered
-# before adding sub properties to them, so they are registered on definition
-# and unregistered on unload
-PropertiesMap = {}
-
-# Using our own loading function we set this to false
-# so when running a script directly in the text editor
-# registers moduals instantly.
-_register_immediate = True
-
-
-def _unregister_module(module, free=True):
-    for t in TypeMap.get(module, ()):
-        try:
-            bpy_types.unregister(t)
-        except:
-            import traceback
-            print("bpy.utils._unregister_module(): Module '%s' failed to unregister class '%s.%s'" % (module, t.__module__, t.__name__))
-            traceback.print_exc()
-
-    if free == True and module in TypeMap:
-        del TypeMap[module]
-
-    for t in PropertiesMap.get(module, ()):
-        try:
-            bpy_types.unregister(t)
-        except:
-            import traceback
-            print("bpy.utils._unload_module(): Module '%s' failed to unregister class '%s.%s'" % (module, t.__module__, t.__name__))
-            traceback.print_exc()
-
-    if free == True and module in PropertiesMap:
-        del PropertiesMap[module]
-
-
-def _register_module(module):
-    for t in TypeMap.get(module, ()):
-        try:
-            bpy_types.register(t)
-        except:
-            import traceback
-            import sys
-            print("bpy.utils._register_module(): '%s' failed to register class '%s.%s'" % (sys.modules[module].__file__, t.__module__, t.__name__))
-            traceback.print_exc()
 
 
 class RNAMeta(type):
-    @classmethod
-    def _register_immediate(cls):
-        return _register_immediate
-
     def __new__(cls, name, bases, classdict, **args):
+        import traceback
         result = type.__new__(cls, name, bases, classdict)
         if bases and bases[0] != StructRNA:
             module = result.__module__
 
-            ClassMap = TypeMap
-
-            # Register right away if needed
-            if cls._register_immediate():
-                bpy_types.register(result)
-                ClassMap = PropertiesMap
-
             # first part of packages only
             if "." in module:
                 module = module[:module.index(".")]
 
-            ClassMap.setdefault(module, []).append(result)
+            sf = traceback.extract_stack(limit=2)[0]
+
+            TypeMap.setdefault(module, []).append((result, sf[0], sf[1]))
 
         return result
 
 
-class RNAMetaRegister(RNAMeta, StructMetaIDProp):
-    @classmethod
-    def _register_immediate(cls):
-        return True
+import collections
+
+
+class RNAMetaIDProp(RNAMeta, StructMetaIDProp):
+    pass
 
 
 class OrderedMeta(RNAMeta):
@@ -685,7 +633,7 @@ class Macro(StructRNA, metaclass=OrderedMeta):
         return ops.macro_define(self, opname)
 
 
-class IDPropertyGroup(StructRNA, metaclass=RNAMetaRegister):
+class IDPropertyGroup(StructRNA, metaclass=RNAMetaIDProp):
         __slots__ = ()
 
 
index e5eab045e9453748d2878fa749fe950bd279dcb9..9262ff40a374d5360078b20804817706833a2833 100644 (file)
@@ -701,4 +701,8 @@ if __name__ == "__main__":
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
+
+
+def unregister():
+    bpy.utils.unregister_module(__name__)
index 0e7f0b69eca1a4971bbc04c349ea292ad62e7c66..6332bbe309c01d0681673bbb7953f92b093f3b81 100644 (file)
@@ -78,13 +78,12 @@ class DiscontFilterOp(bpy.types.Operator):
         main(context)
         return {'FINISHED'}
 
-
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index ddd04c4e7c38d9b5dec49d1767539af39f44ef1b..e1d471f825446d07846b85fabaafe7302450569b 100644 (file)
@@ -195,11 +195,11 @@ class ProjectApply(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 447de04f42399cc143611e552c803249bec94a97..4906fd7fc6cb9090da8d05971a67b03642d0b355 100644 (file)
@@ -173,11 +173,11 @@ class MeshMirrorUV(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index d47668d68e3a85d4732dbc328fcdd2d26f5f25a2..5711fdf12e5d0bdf6f62eeb71e3ef385208762d6 100644 (file)
@@ -175,13 +175,11 @@ class BakeAction(bpy.types.Operator):
 
 
 def register():
-    pass
-    # bpy.types.INFO_MT_mesh_add.append(menu_func)
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
-    # bpy.types.INFO_MT_mesh_add.remove(menu_func)
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 8fee6e2166d0d31805ce4b058a63dbd74066e9ff..928866899721fdfa05206dd74d567f82eed00c8a 100644 (file)
@@ -565,11 +565,11 @@ class ClearAllRestrictRender(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 8654fb4db3d85db844daf5a75f14bb02ada2ca9d..d98fe584c1a2670e03293fc4c02e2a8228fbdd29 100644 (file)
@@ -287,11 +287,14 @@ def menu_func(self, context):
 
 
 def register():
+    bpy.utils.register_module(__name__)
     bpy.types.VIEW3D_MT_transform.append(menu_func)
 
 
 def unregister():
+    bpy.utils.unregister_module(__name__)
     bpy.types.VIEW3D_MT_transform.remove(menu_func)
 
+
 if __name__ == "__main__":
     register()
index 8b8070f34bcd0534b575b5264d2641e47dc9b89e..ee7a5f98b91fe3ed60226451b25328b5c56d1319 100644 (file)
@@ -154,11 +154,14 @@ def menu_func(self, context):
 
 
 def register():
+    bpy.utils.register_module(__name__)
     bpy.types.VIEW3D_MT_transform.append(menu_func)
 
 
 def unregister():
+    bpy.utils.unregister_module(__name__)
     bpy.types.VIEW3D_MT_transform.remove(menu_func)
 
+
 if __name__ == "__main__":
     register()
index 36170fb628351aac8659d33a60530476827990e6..65653aeee3e60ff2a385ae3ac1b9efe25b7a8a6a 100644 (file)
@@ -354,11 +354,11 @@ class WM_MT_operator_presets(bpy.types.Menu):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 244c3d4b332acbdd0cb55f1ffee8ec7e727d9612..579af9b34b3e2f5d5c08374da83d135d9716c926 100644 (file)
@@ -147,11 +147,11 @@ class PlayRenderedAnim(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index e34489b335d66171ac90b7a5e01f4c32d508268a..de341bef269dc2e4f129541eeabad54d6a08c5a6 100644 (file)
@@ -135,11 +135,11 @@ class SequencerDeinterlaceSelectedMovies(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 
 if __name__ == "__main__":
index 1b6c036b2d26cc521b2764ffa56e953b8facd094..83282924b5be2342a3b5eec6b43709a962a6b87a 100644 (file)
@@ -369,10 +369,12 @@ def menu_func(self, context):
 
 
 def register():
+    bpy.utils.register_module(__name__)
     bpy.types.IMAGE_MT_uvs.append(menu_func)
 
 
 def unregister():
+    bpy.utils.unregister_module(__name__)
     bpy.types.IMAGE_MT_uvs.remove(menu_func)
 
 if __name__ == "__main__":
index a226e234f3a8a3b90454fbb5cfd193a1bbf84df2..12895fae1c539cf492b3ba7883840ed722170168 100644 (file)
@@ -251,11 +251,14 @@ menu_func = (lambda self, context: self.layout.operator(FollowActiveQuads.bl_idn
 
 
 def register():
+    bpy.utils.register_module(__name__)
     bpy.types.VIEW3D_MT_uv_map.append(menu_func)
 
 
 def unregister():
+    bpy.utils.unregister_module(__name__)
     bpy.types.VIEW3D_MT_uv_map.remove(menu_func)
 
+
 if __name__ == "__main__":
     register()
index aaa8583b70f8f8d37b271422294ae99f2134df60..8cdf593f98de4e98b35f00887d4e2cb0ffc6c61b 100644 (file)
@@ -1130,10 +1130,12 @@ menu_func = (lambda self, context: self.layout.operator(SmartProject.bl_idname,
 
 
 def register():
+    bpy.utils.register_module(__name__)
     bpy.types.VIEW3D_MT_uv_map.append(menu_func)
 
 
 def unregister():
+    bpy.utils.unregister_module(__name__)
     bpy.types.VIEW3D_MT_uv_map.remove(menu_func)
 
 if __name__ == "__main__":
index c5bb4450497d9cc077ef13d105032cadc6ac333c..5102c94af695b7718be72a6d9175dffbb4af8f36 100644 (file)
@@ -180,11 +180,11 @@ class VertexPaintDirt(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 38fead4ecf8df39aa7146033b0c646ea3bc21c2b..cbc9e3cd55f7783a2eaab1fe69417429deca456f 100644 (file)
@@ -816,11 +816,11 @@ class WM_OT_sysinfo(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 87925a9d6f49ac371a483335026e3068e17f5571..5f5684f5c89ab8d2bd044ea7774061856c6b2ab4 100644 (file)
@@ -94,12 +94,13 @@ class OnionSkinButtonsPanel():
 
 # NOTE:
 # The specialised panel types are derived in their respective UI modules
+# dont register these classes since they are only helpers.
 def register():
-    pass
+    pass  # bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    pass  # bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index c3d3c358dbec237cdb5018a17af090359f4caff7..6550e1bb1ed687429126763cc59546b97aeadff1 100644 (file)
@@ -289,11 +289,11 @@ class DATA_PT_custom_props_arm(ArmatureButtonsPanel, PropertyPanel, bpy.types.Pa
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 336fc5430c640f12ea2423a1f3c5530479a7d852..feca4fc2502fd86c89a5c61283ba37e09fe79974 100644 (file)
@@ -370,11 +370,11 @@ class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 9c4f19b4c51630c8c5b28498b9061b9fe6ef486e..0f5d4a59bf5fd7091c8cef9af6a3be2fff9e4b09 100644 (file)
@@ -139,11 +139,11 @@ class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, bpy.types.P
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 85a32236bcc9ed90d23e1e186e31d28779db89e8..b26b7140fd26afcaacc0f440a2ac7365e015676b 100644 (file)
@@ -396,11 +396,11 @@ class DATA_PT_custom_props_curve(CurveButtonsPanel, PropertyPanel, bpy.types.Pan
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 9a297eba4af97f09560980c92539b068b9202eec..bb0028efec5c1f0e4bc5edfdd19e8cd2fe8bd2c6 100644 (file)
@@ -44,11 +44,11 @@ class DATA_PT_empty(DataButtonsPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 9961bf1e77fb1dd598c95c5816f80cd2eea7a13c..55781434763add84b44e698326b3933c8b1e6330 100644 (file)
@@ -394,11 +394,11 @@ class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, bpy.types.Panel
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index ae9e9e6f3a89571bef4ce1447b252f6e51f7f2e5..6bdb36d3520bf17c9f7cd4867db6779373d24e8c 100644 (file)
@@ -89,11 +89,11 @@ class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, bpy.types.Pa
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 44080b1ffe5f60b987f3b6e97263d74a60ee29fd..342204d0e7867d0da3e65669e4a40e5f9e8a4a90 100644 (file)
@@ -355,11 +355,11 @@ class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, bpy.types.Panel
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index bbe027c5ea446adf9797eb0c74e4e77a96d566be..cf7aa8c08fd99c41d134b7c55f7b2c1b3f048856 100644 (file)
@@ -119,11 +119,11 @@ class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, bpy.types.P
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 7a1ea160abceb751fa6b943e211007b0f35066d5..e93b34fe0556e18f57ea2e92d06fd58ef04b9adb 100644 (file)
@@ -701,11 +701,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 77f4da5d405282f88285123ecde9418629dbe429..2717e315ee8287d7af235cd248d778793bc5ecdf 100644 (file)
@@ -510,11 +510,11 @@ class WORLD_PT_game_physics(WorldButtonsPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 6bfebc444b9369596bccd76b4c287667f80e8b9e..82c3e840420cc3b6fab73be6b5f4b99218bdd42e 100644 (file)
@@ -896,11 +896,11 @@ class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, bpy.types.Pa
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 72ae26c1de2748e91bc689b6a98df56853724626..30380e2d3387f5b1db68b67445bbb8fe6c42bd2d 100644 (file)
@@ -343,11 +343,11 @@ class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, bpy.types.Panel)
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 4f1d121b3fccc28e3dc7546fb936095a92512b56..4b9c28852775fbacca230109a412bf3fd0c49d70 100644 (file)
@@ -749,11 +749,11 @@ class BONE_PT_constraints(ConstraintButtonsPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 27a9a972154e3bbfc6349dd00f261863de1c9f19..4bed2e816292a554b82d10c42dbb44bba8fbb005 100644 (file)
@@ -1158,11 +1158,11 @@ class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel, bpy.types.Pa
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index f33804c4c6dd4f0ca80a0a96ff43cabf067705ed..0ac4429c71ab284627ff6e83984edc32642824d6 100644 (file)
@@ -217,11 +217,11 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index ec6ec21fa267c1eb3dd7d60bbc64cb6b207c87b1..3d854533506286982e613b5055c7d24982151d21 100644 (file)
@@ -279,11 +279,11 @@ def basic_force_field_falloff_ui(self, context, field):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index f46f78ca017368871843f5d47dadb6092761dd7a..8a697806aa12c22c9320ac3f95a01c59fc30b3b0 100644 (file)
@@ -217,11 +217,11 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 5cc94c24c80ce8c549a20a3af4f07b2ce38bccc7..6385a535a447f1bce6419e8fa5ef304e9bde8b42 100644 (file)
@@ -282,11 +282,11 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 0ca5f03f83231ab3f0917275afab5b7af36fcd24..56ddff292d9f670edfed20bf0bb0cc5349b10a2a 100644 (file)
@@ -205,11 +205,11 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 343b198fa8416d226a4896d11629ef6b24069c81..7d3fa66ed02a5a658b73825c63d1f3b45a044c9c 100644 (file)
@@ -262,11 +262,11 @@ class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 99b75b59fdd33d3e48c01861413783bb0f399204..5dfed9ccb2050157b8fc9a98f65a44fccf1fb6ed 100644 (file)
@@ -675,11 +675,11 @@ class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 5085e8d2ab5d2939ef4a7ca04c261e9436572504..d3586c645e65dd38d738f9edbe4f289564c58199 100644 (file)
@@ -311,11 +311,11 @@ class ANIM_OT_keying_set_export(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 8063dc92166e2c21bd4a681e1e9fcf9cc0098c7f..05e130fac2d3ec4bbd9521a003f78c15210500cd 100644 (file)
@@ -1024,11 +1024,11 @@ class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, bpy.types.Pane
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 0ab39ce6fdb077ccdfcf5f59dad5ecec704fd863..fd11f299f34b490d48ae11b5315e371f4c56ae01 100644 (file)
@@ -268,11 +268,11 @@ class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 99ddeb136518644c81567afbf5a3ab764aa0180a..b3bd886d8c5b50d152942621bac5cade16180c0f 100644 (file)
@@ -163,11 +163,11 @@ class ConsoleLanguage(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 9d6c98306754de239d3d061a14023d09402052e1..9a1acfd76b831cce0be5735c9b8639f685455912 100644 (file)
@@ -355,11 +355,11 @@ class DOPESHEET_MT_gpencil_frame(bpy.types.Menu):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index dea306277f194ef22105c8f1a833c12e13c99841..2d66bb386377ee8ad8f674375db80cbc5c7bbdfd 100644 (file)
@@ -75,11 +75,11 @@ class FILEBROWSER_HT_header(bpy.types.Header):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 235ed54ef0bae29bf665fa022ffb36ca6cf6feb6..55c4d4cfd949671ca977bb046b2cb530c3fa10eb 100644 (file)
@@ -242,11 +242,11 @@ class GRAPH_MT_key_transform(bpy.types.Menu):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 464e5bb8cfeb30ab4f0c8ea948570e631513d71e..433c12b0620c8a84764b2f844b3e2dd1bd9a1e8b 100644 (file)
@@ -727,11 +727,11 @@ class IMAGE_PT_paint_curve(BrushButtonsPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 9881cb55692801521c2f06fcd212265c7b3a8b1b..6c392cb9a3dc593e0c983fd608f8620f25dbe2b9 100644 (file)
@@ -404,11 +404,11 @@ class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 44c6f5fd6849945b257e3c07c0b4061073543867..54dde61e90a16f60792c5d3b344f52955f8bd2cb 100644 (file)
@@ -90,11 +90,11 @@ class LOGIC_MT_view(bpy.types.Menu):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 1921e80035d3823b5f608b3ea7a3854b73cb3093..13afc97f91392d1be2cf0f9cce2e401a2830ff61 100644 (file)
@@ -188,11 +188,11 @@ class NLA_MT_edit_transform(bpy.types.Menu):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 64d833434e5b8d3d5a123bffe4618a28b7ff2d7f..aaf14813ee564f104869f6ad7a70ef09ec130741 100644 (file)
@@ -197,11 +197,11 @@ class NODE_PT_properties(bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 38e749c4a758bfb36cf63519c11c1d0528892054..219dd1de1176ab5d6eb6925f90d9b55806814797 100644 (file)
@@ -118,11 +118,11 @@ class OUTLINER_MT_edit_datablocks(bpy.types.Menu):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 110cb74d3c502879fde7697d517431797d8c07b5..3ae1e35aaf84b3762bf8d7c2c07f00ec312a9309 100644 (file)
@@ -831,11 +831,11 @@ class SEQUENCER_PT_view(SequencerButtonsPanel_Output, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 58f12ba51e40eec1f57dd9de2e0769e2864a9623..df5967c91288f922cc9985ea942704d4bcc9153b 100644 (file)
@@ -295,11 +295,11 @@ class TEXT_MT_toolbox(bpy.types.Menu):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index c1293e87c854367eec1a19b1cc36b384459cdce1..046274abc897fd693b52b6402a561f2a89a8754e 100644 (file)
@@ -200,11 +200,11 @@ class TIME_MT_autokey(bpy.types.Menu):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index ff88ed4008c6e6a4be12227a4ac96715073273a6..79bdff8ad93162213a83941e58a8d4deb54c9838 100644 (file)
@@ -1276,11 +1276,11 @@ class WM_OT_addon_expand(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index 316e4e2be10a94b8724aae95a6ba4a15d8b10c0c..a78ef1be36fd07979c799e5642197e6788d2618c 100644 (file)
@@ -787,11 +787,11 @@ class WM_OT_keyconfig_remove(bpy.types.Operator):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index eafb46b133d0a87431b643dffea95d0c0ab95971..162322a8720d27e7fa4b70bc7bddfdd5a1bb0583 100644 (file)
@@ -2306,11 +2306,11 @@ class VIEW3D_PT_context_properties(bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()
index c3280a67b7e457a8234043bd0eda1ce711f3a02d..163e02817a40efa1a114dc0fda836de265338f5b 100644 (file)
@@ -1302,11 +1302,11 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, bpy.types.Panel):
 
 
 def register():
-    pass
+    bpy.utils.register_module(__name__)
 
 
 def unregister():
-    pass
+    bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
     register()