diff options
Diffstat (limited to 'release/scripts/modules/bpy/utils/__init__.py')
-rw-r--r-- | release/scripts/modules/bpy/utils/__init__.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py index b3257c30a97..80e48697b2f 100644 --- a/release/scripts/modules/bpy/utils/__init__.py +++ b/release/scripts/modules/bpy/utils/__init__.py @@ -34,7 +34,6 @@ __all__ = ( "refresh_script_paths", "app_template_paths", "register_class", - "register_module", "register_manual_map", "unregister_manual_map", "register_classes_factory", @@ -50,7 +49,6 @@ __all__ = ( "smpte_from_seconds", "units", "unregister_class", - "unregister_module", "user_resource", ) @@ -166,10 +164,6 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): for module_name in [ext.module for ext in _user_preferences.addons]: _addon_utils.disable(module_name) - # *AFTER* unregistering all add-ons, otherwise all calls to - # unregister_module() will silently fail (do nothing). - _bpy_types.TypeMap.clear() - def register_module_call(mod): register = getattr(mod, "register", None) if register: @@ -655,58 +649,6 @@ def user_resource(resource_type, path="", create=False): return target_path -def _bpy_module_classes(module, is_registered=False): - typemap_list = _bpy_types.TypeMap.get(module, ()) - i = 0 - while i < len(typemap_list): - cls_weakref = typemap_list[i] - cls = cls_weakref() - - if cls is None: - del typemap_list[i] - else: - if is_registered == cls.is_registered: - yield cls - i += 1 - - -def register_module(module, verbose=False): - if verbose: - print("bpy.utils.register_module(%r): ..." % module) - cls = None - for cls in _bpy_module_classes(module, is_registered=False): - if verbose: - print(" %r" % cls) - try: - register_class(cls) - except: - print("bpy.utils.register_module(): " - "failed to registering class %r" % cls) - import traceback - traceback.print_exc() - if verbose: - print("done.\n") - if cls is None: - raise Exception("register_module(%r): defines no classes" % module) - - -def unregister_module(module, verbose=False): - if verbose: - print("bpy.utils.unregister_module(%r): ..." % module) - for cls in _bpy_module_classes(module, is_registered=True): - if verbose: - print(" %r" % cls) - try: - unregister_class(cls) - except: - print("bpy.utils.unregister_module(): " - "failed to unregistering class %r" % cls) - import traceback - traceback.print_exc() - if verbose: - print("done.\n") - - def register_classes_factory(classes): """ Utility function to create register and unregister functions |