[Bf-extensions-cvs] [c74a4e7d] master: sun_position: set default date to today

Damien Picard noreply at git.blender.org
Wed Dec 4 01:42:34 CET 2019


Commit: c74a4e7d5ae268d6a53edb01a2d2edd94076e8c1
Author: Damien Picard
Date:   Tue Dec 3 14:12:15 2019 +0100
Branches: master
https://developer.blender.org/rBACc74a4e7d5ae268d6a53edb01a2d2edd94076e8c1

sun_position: set default date to today

===================================================================

M	sun_position/properties.py

===================================================================

diff --git a/sun_position/properties.py b/sun_position/properties.py
index d0a3e323..c586dcd1 100644
--- a/sun_position/properties.py
+++ b/sun_position/properties.py
@@ -24,6 +24,8 @@ from bpy.props import (StringProperty, EnumProperty, IntProperty,
 from .sun_calc import sun_update, parse_coordinates
 from .north import north_update
 
+from datetime import datetime
+TODAY = datetime.today()
 
 ############################################################################
 # Sun panel properties
@@ -93,21 +95,21 @@ class SunPosProperties(PropertyGroup):
         attr="",
         name="Month",
         description="",
-        min=1, max=12, default=6,
+        min=1, max=12, default=TODAY.month,
         update=sun_update)
 
     day: IntProperty(
         attr="",
         name="Day",
         description="",
-        min=1, max=31, default=21,
+        min=1, max=31, default=TODAY.day,
         update=sun_update)
 
     year: IntProperty(
         attr="",
         name="Year",
         description="",
-        min=1800, max=4000, default=2012,
+        min=1800, max=4000, default=TODAY.year,
         update=sun_update)
 
     use_day_of_year: BoolProperty(



More information about the Bf-extensions-cvs mailing list