File headers: use SPDX license identifiers
[blender-addons.git] / sun_position / __init__.py
blob34808dd41e05694b38d8378416f95656b5401eb4
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 # <pep8 compliant>
18 bl_info = {
19 "name": "Sun Position",
20 "author": "Michael Martin",
21 "version": (3, 1, 2),
22 "blender": (3, 0, 0),
23 "location": "World > Sun Position",
24 "description": "Show sun position with objects and/or sky texture",
25 "doc_url": "{BLENDER_MANUAL_URL}/addons/lighting/sun_position.html",
26 "category": "Lighting",
29 if "bpy" in locals():
30 import importlib
31 importlib.reload(properties)
32 importlib.reload(ui_sun)
33 importlib.reload(hdr)
35 else:
36 from . import properties, ui_sun, hdr
38 import bpy
41 def register():
42 bpy.utils.register_class(properties.SunPosProperties)
43 bpy.types.Scene.sun_pos_properties = (
44 bpy.props.PointerProperty(type=properties.SunPosProperties,
45 name="Sun Position",
46 description="Sun Position Settings"))
47 bpy.utils.register_class(properties.SunPosAddonPreferences)
48 bpy.utils.register_class(ui_sun.SUNPOS_OT_AddPreset)
49 bpy.utils.register_class(ui_sun.SUNPOS_MT_Presets)
50 bpy.utils.register_class(ui_sun.SUNPOS_PT_Panel)
51 bpy.utils.register_class(ui_sun.SUNPOS_PT_Location)
52 bpy.utils.register_class(ui_sun.SUNPOS_PT_Time)
53 bpy.utils.register_class(hdr.SUNPOS_OT_ShowHdr)
55 bpy.app.handlers.frame_change_post.append(sun_calc.sun_handler)
58 def unregister():
59 bpy.utils.unregister_class(hdr.SUNPOS_OT_ShowHdr)
60 bpy.utils.unregister_class(ui_sun.SUNPOS_PT_Panel)
61 bpy.utils.unregister_class(ui_sun.SUNPOS_PT_Location)
62 bpy.utils.unregister_class(ui_sun.SUNPOS_PT_Time)
63 bpy.utils.unregister_class(ui_sun.SUNPOS_MT_Presets)
64 bpy.utils.unregister_class(ui_sun.SUNPOS_OT_AddPreset)
65 bpy.utils.unregister_class(properties.SunPosAddonPreferences)
66 del bpy.types.Scene.sun_pos_properties
67 bpy.utils.unregister_class(properties.SunPosProperties)
69 bpy.app.handlers.frame_change_post.remove(sun_calc.sun_handler)