Sun Position: update French translations
[blender-addons.git] / sun_position / __init__.py
bloba2763ce2fdde514e08c1090b5df58a0fced13a55
1 # SPDX-License-Identifier: GPL-2.0-or-later
3 # --------------------------------------------------------------------------
4 # The sun positioning algorithms are based on the National Oceanic
5 # and Atmospheric Administration's (NOAA) Solar Position Calculator
6 # which rely on calculations of Jean Meeus' book "Astronomical Algorithms."
7 # Use of NOAA data and products are in the public domain and may be used
8 # freely by the public as outlined in their policies at
9 # www.nws.noaa.gov/disclaimer.php
10 # --------------------------------------------------------------------------
11 # The geo parser script is by Maximilian Högner, released
12 # under the GNU GPL license:
13 # http://hoegners.de/Maxi/geo/
14 # --------------------------------------------------------------------------
16 bl_info = {
17 "name": "Sun Position",
18 "author": "Michael Martin, Damien Picard",
19 "version": (3, 4, 0),
20 "blender": (3, 0, 0),
21 "location": "World > Sun Position",
22 "description": "Show sun position with objects and/or sky texture",
23 "doc_url": "{BLENDER_MANUAL_URL}/addons/lighting/sun_position.html",
24 "category": "Lighting",
27 if "bpy" in locals():
28 import importlib
29 importlib.reload(properties)
30 importlib.reload(ui_sun)
31 importlib.reload(hdr)
32 importlib.reload(translations)
34 else:
35 from . import properties, ui_sun, hdr, translations
37 import bpy
38 from bpy.app.handlers import persistent
41 register_classes, unregister_classes = bpy.utils.register_classes_factory(
42 (properties.SunPosProperties,
43 properties.SunPosAddonPreferences, ui_sun.SUNPOS_OT_AddPreset,
44 ui_sun.SUNPOS_MT_Presets, ui_sun.SUNPOS_PT_Panel,
45 ui_sun.SUNPOS_PT_Location, ui_sun.SUNPOS_PT_Time, hdr.SUNPOS_OT_ShowHdr))
48 @persistent
49 def sun_scene_handler(scene):
50 sun_props = bpy.context.scene.sun_pos_properties
52 # Force drawing update
53 sun_props.show_surface = sun_props.show_surface
54 sun_props.show_analemmas = sun_props.show_analemmas
55 sun_props.show_north = sun_props.show_north
57 # Force coordinates update
58 sun_props.latitude = sun_props.latitude
61 def register():
62 register_classes()
63 bpy.types.Scene.sun_pos_properties = (
64 bpy.props.PointerProperty(type=properties.SunPosProperties,
65 name="Sun Position",
66 description="Sun Position Settings"))
67 bpy.app.handlers.frame_change_post.append(sun_calc.sun_handler)
68 bpy.app.handlers.load_post.append(sun_scene_handler)
69 bpy.app.translations.register(__name__, translations.translations_dict)
72 def unregister():
73 bpy.app.translations.unregister(__name__)
74 bpy.app.handlers.frame_change_post.remove(sun_calc.sun_handler)
75 bpy.app.handlers.load_post.remove(sun_scene_handler)
76 del bpy.types.Scene.sun_pos_properties
77 unregister_classes()