Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sun_position/__init__.py')
-rw-r--r--sun_position/__init__.py39
1 files changed, 16 insertions, 23 deletions
diff --git a/sun_position/__init__.py b/sun_position/__init__.py
index 01e22df0..5b2a89ce 100644
--- a/sun_position/__init__.py
+++ b/sun_position/__init__.py
@@ -29,39 +29,32 @@ if "bpy" in locals():
importlib.reload(properties)
importlib.reload(ui_sun)
importlib.reload(hdr)
+ importlib.reload(translations)
else:
- from . import properties, ui_sun, hdr
+ from . import properties, ui_sun, hdr, translations
import bpy
+register_classes, unregister_classes = bpy.utils.register_classes_factory(
+ (properties.SunPosProperties,
+ properties.SunPosAddonPreferences, ui_sun.SUNPOS_OT_AddPreset,
+ ui_sun.SUNPOS_MT_Presets, ui_sun.SUNPOS_PT_Panel,
+ ui_sun.SUNPOS_PT_Location, ui_sun.SUNPOS_PT_Time, hdr.SUNPOS_OT_ShowHdr))
+
+
def register():
- bpy.utils.register_class(properties.SunPosProperties)
+ register_classes()
bpy.types.Scene.sun_pos_properties = (
bpy.props.PointerProperty(type=properties.SunPosProperties,
- name="Sun Position",
- description="Sun Position Settings"))
- bpy.utils.register_class(properties.SunPosAddonPreferences)
- bpy.utils.register_class(ui_sun.SUNPOS_OT_AddPreset)
- bpy.utils.register_class(ui_sun.SUNPOS_MT_Presets)
- bpy.utils.register_class(ui_sun.SUNPOS_PT_Panel)
- bpy.utils.register_class(ui_sun.SUNPOS_PT_Location)
- bpy.utils.register_class(ui_sun.SUNPOS_PT_Time)
- bpy.utils.register_class(hdr.SUNPOS_OT_ShowHdr)
-
+ name="Sun Position",
+ description="Sun Position Settings"))
bpy.app.handlers.frame_change_post.append(sun_calc.sun_handler)
-
+ bpy.app.translations.register(__name__, translations.translations_dict)
def unregister():
- bpy.utils.unregister_class(hdr.SUNPOS_OT_ShowHdr)
- bpy.utils.unregister_class(ui_sun.SUNPOS_PT_Panel)
- bpy.utils.unregister_class(ui_sun.SUNPOS_PT_Location)
- bpy.utils.unregister_class(ui_sun.SUNPOS_PT_Time)
- bpy.utils.unregister_class(ui_sun.SUNPOS_MT_Presets)
- bpy.utils.unregister_class(ui_sun.SUNPOS_OT_AddPreset)
- bpy.utils.unregister_class(properties.SunPosAddonPreferences)
- del bpy.types.Scene.sun_pos_properties
- bpy.utils.unregister_class(properties.SunPosProperties)
-
+ bpy.app.translations.unregister(__name__)
bpy.app.handlers.frame_change_post.remove(sun_calc.sun_handler)
+ del bpy.types.Scene.sun_pos_properties
+ unregister_classes()