def unregister(): """Unregister importers, exporters and panels.""" bpy.utils.unregister_class(AddonPreferences) Registration.unregister_importers() Registration.unregister_exporters() bpy.utils.unregister_class(OpenGLPanel) log_report("INFO", "Unregistered {}".format(bl_info["name"]))
def register(): """Register importers, exporters and panels.""" bpy.utils.register_class(AddonPreferences) import_export_prefs = bpy.context.preferences.addons[__name__].preferences Registration.register_importers(import_export_prefs) Registration.register_exporters(import_export_prefs) bpy.utils.register_class(OpenGLPanel) log_report( "INFO", "Registered {} with {} modules".format(bl_info["name"], len(modules)), )
def execute(self, context): """Activate and deactivate importers and exporters. Uses the selected options of :class:`.AddonPreferences` to determine active and inactive importers and exporters. """ log_report("INFO", "Update importers and exporters: ...", self) addon_name = _get_addon_name() import_export_prefs = bpy.context.preferences.addons[ addon_name].preferences Registration.unregister_importers() Registration.register_importers(import_export_prefs) Registration.unregister_exporters() Registration.register_exporters(import_export_prefs) log_report("INFO", "Update importers and exporters: Done", self) return {"FINISHED"}