1 ### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
19 # --------------------------------------------------------------------------
20 # The sun positioning algorithms are based on the National Oceanic
21 # and Atmospheric Administration's (NOAA) Solar Position Calculator
22 # which rely on calculations of Jean Meeus' book "Astronomical Algorithms."
23 # Use of NOAA data and products are in the public domain and may be used
24 # freely by the public as outlined in their policies at
25 # www.nws.noaa.gov/disclaimer.php
26 # --------------------------------------------------------------------------
27 # The geo parser script is by Maximilian Högner, released
28 # under the GNU GPL license:
29 # http://hoegners.de/Maxi/geo/
30 # --------------------------------------------------------------------------
35 "name": "Sun Position",
36 "author": "Michael Martin",
38 "blender": (2, 80, 0),
39 "location": "World > Sun Position",
40 "description": "Show sun position with objects and/or sky texture",
41 "doc_url": "{BLENDER_MANUAL_URL}/addons/lighting/sun_position.html",
42 "category": "Lighting",
47 importlib
.reload(properties
)
48 importlib
.reload(ui_sun
)
52 from . import properties
, ui_sun
, hdr
58 bpy
.utils
.register_class(properties
.SunPosProperties
)
59 bpy
.types
.Scene
.sun_pos_properties
= (
60 bpy
.props
.PointerProperty(type=properties
.SunPosProperties
,
62 description
="Sun Position Settings"))
63 bpy
.utils
.register_class(properties
.SunPosAddonPreferences
)
64 bpy
.utils
.register_class(ui_sun
.SUNPOS_OT_AddPreset
)
65 bpy
.utils
.register_class(ui_sun
.SUNPOS_MT_Presets
)
66 bpy
.utils
.register_class(ui_sun
.SUNPOS_PT_Panel
)
67 bpy
.utils
.register_class(ui_sun
.SUNPOS_PT_Location
)
68 bpy
.utils
.register_class(ui_sun
.SUNPOS_PT_Time
)
69 bpy
.utils
.register_class(hdr
.SUNPOS_OT_ShowHdr
)
71 bpy
.app
.handlers
.frame_change_post
.append(sun_calc
.sun_handler
)
75 bpy
.utils
.unregister_class(hdr
.SUNPOS_OT_ShowHdr
)
76 bpy
.utils
.unregister_class(ui_sun
.SUNPOS_PT_Panel
)
77 bpy
.utils
.unregister_class(ui_sun
.SUNPOS_PT_Location
)
78 bpy
.utils
.unregister_class(ui_sun
.SUNPOS_PT_Time
)
79 bpy
.utils
.unregister_class(ui_sun
.SUNPOS_MT_Presets
)
80 bpy
.utils
.unregister_class(ui_sun
.SUNPOS_OT_AddPreset
)
81 bpy
.utils
.unregister_class(properties
.SunPosAddonPreferences
)
82 del bpy
.types
.Scene
.sun_pos_properties
83 bpy
.utils
.unregister_class(properties
.SunPosProperties
)
85 bpy
.app
.handlers
.frame_change_post
.remove(sun_calc
.sun_handler
)