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

__init__.py « sun_position - git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5b2a89cec5495eebac209a8d1984c9eb41a8f000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# SPDX-License-Identifier: GPL-2.0-or-later

# --------------------------------------------------------------------------
# The sun positioning algorithms are based on the National Oceanic
# and Atmospheric Administration's (NOAA) Solar Position Calculator
# which rely on calculations of Jean Meeus' book "Astronomical Algorithms."
# Use of NOAA data and products are in the public domain and may be used
# freely by the public as outlined in their policies at
#               www.nws.noaa.gov/disclaimer.php
# --------------------------------------------------------------------------
# The geo parser script is by Maximilian Högner, released
# under the GNU GPL license:
# http://hoegners.de/Maxi/geo/
# --------------------------------------------------------------------------

bl_info = {
    "name": "Sun Position",
    "author": "Michael Martin",
    "version": (3, 1, 2),
    "blender": (3, 0, 0),
    "location": "World > Sun Position",
    "description": "Show sun position with objects and/or sky texture",
    "doc_url": "{BLENDER_MANUAL_URL}/addons/lighting/sun_position.html",
    "category": "Lighting",
}

if "bpy" in locals():
    import importlib
    importlib.reload(properties)
    importlib.reload(ui_sun)
    importlib.reload(hdr)
    importlib.reload(translations)

else:
    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():
    register_classes()
    bpy.types.Scene.sun_pos_properties = (
        bpy.props.PointerProperty(type=properties.SunPosProperties,
                                  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.app.translations.unregister(__name__)
    bpy.app.handlers.frame_change_post.remove(sun_calc.sun_handler)
    del bpy.types.Scene.sun_pos_properties
    unregister_classes()