Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons-contrib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons-contrib
Commits
d8250250
Commit
d8250250
authored
Jul 29, 2017
by
Stephen Leger
Browse files
Options
Downloads
Patches
Plain Diff
lamp_geographical_sun T49359 fix mess with east and west
parent
e1a1159c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lamp_geographical_sun.py
+131
-131
131 additions, 131 deletions
lamp_geographical_sun.py
with
131 additions
and
131 deletions
lamp_geographical_sun.py
+
131
−
131
View file @
d8250250
...
...
@@ -150,85 +150,85 @@ class sun_calculator(object):
location_data
=
{
# Europe
67
:
(
51.2167
,
-
4.4
,
1
),
1
:
(
52.33
,
-
13.30
,
1
),
70
:
(
48.17
,
-
17.17
,
1
),
72
:
(
49.2
,
-
16.63
,
1
),
68
:
(
58.8467
,
-
4.3525
,
1
),
65
:
(
46.217
,
-
6.150
,
1
),
7
:
(
60.1667
,
-
24.9667
,
2
),
62
:
(
47.2672
,
-
11.3928
,
1
),
64
:
(
50.75
,
-
30.0833
,
2
),
67
:
(
51.2167
,
4.4
,
1
),
1
:
(
52.33
,
13.30
,
1
),
70
:
(
48.17
,
17.17
,
1
),
72
:
(
49.2
,
16.63
,
1
),
68
:
(
58.8467
,
4.3525
,
1
),
65
:
(
46.217
,
6.150
,
1
),
7
:
(
60.1667
,
24.9667
,
2
),
62
:
(
47.2672
,
11.3928
,
1
),
64
:
(
50.75
,
30.0833
,
2
),
10
:
(
51.50
,
0.0
,
0
),
66
:
(
45.767
,
-
4.833
,
1
),
69
:
(
48.32
,
-
18.07
,
1
),
58
:
(
59.56
,
-
10.41
,
1
),
15
:
(
48.8667
,
-
2.667
,
1
),
71
:
(
50.08
,
-
14.46
,
1
),
18
:
(
41.90
,
-
12.4833
,
1
),
63
:
(
47.3
,
-
11.0667
,
1
),
74
:
(
52.232
,
-
21.008
,
1
),
73
:
(
51.108
,
-
17.038
,
1
),
21
:
(
47.3833
,
-
8.5333
,
1
),
66
:
(
45.767
,
4.833
,
1
),
69
:
(
48.32
,
18.07
,
1
),
58
:
(
59.56
,
10.41
,
1
),
15
:
(
48.8667
,
2.667
,
1
),
71
:
(
50.08
,
14.46
,
1
),
18
:
(
41.90
,
12.4833
,
1
),
63
:
(
47.3
,
11.0667
,
1
),
74
:
(
52.232
,
21.008
,
1
),
73
:
(
51.108
,
17.038
,
1
),
21
:
(
47.3833
,
8.5333
,
1
),
# World Cities
0
:
(
39.9167
,
-
116.4167
,
8
),
2
:
(
18.9333
,
-
72.8333
,
5.5
),
3
:
(
-
34.60
,
58.45
,
-
3
),
4
:
(
30.10
,
-
31.3667
,
2
),
5
:
(
-
33.9167
,
-
18.3667
,
2
),
6
:
(
10.50
,
66.9333
,
-
4
),
60
:
(
-
25.4278
,
49.2731
,
-
3
),
8
:
(
22.25
,
-
114.1667
,
8
),
9
:
(
31.7833
,
-
35.2333
,
2
),
61
:
(
-
29.3044
,
48.8456
,
-
3
),
11
:
(
19.4
,
99.15
,
-
6
),
12
:
(
55.75
,
-
37.5833
,
3
),
13
:
(
28.6
,
-
77.2
,
5.5
),
14
:
(
45.41667
,
75.7
,
-
5
),
16
:
(
-
22.90
,
43.2333
,
-
3
),
17
:
(
24.633
,
-
46.71667
,
3
),
59
:
(
-
23.5475
,
46.6361
,
-
3
),
19
:
(
-
33.8667
,
-
151.2167
,
10
),
20
:
(
35.70
,
-
139.7667
,
9
),
0
:
(
39.9167
,
116.4167
,
8
),
2
:
(
18.9333
,
72.8333
,
5.5
),
3
:
(
-
34.60
,
-
58.45
,
-
3
),
4
:
(
30.10
,
31.3667
,
2
),
5
:
(
-
33.9167
,
18.3667
,
2
),
6
:
(
10.50
,
-
66.9333
,
-
4
),
60
:
(
-
25.4278
,
-
49.2731
,
-
3
),
8
:
(
22.25
,
114.1667
,
8
),
9
:
(
31.7833
,
35.2333
,
2
),
61
:
(
-
29.3044
,
-
48.8456
,
-
3
),
11
:
(
19.4
,
-
99.15
,
-
6
),
12
:
(
55.75
,
37.5833
,
3
),
13
:
(
28.6
,
77.2
,
5.5
),
14
:
(
45.41667
,
-
75.7
,
-
5
),
16
:
(
-
22.90
,
-
43.2333
,
-
3
),
17
:
(
24.633
,
46.71667
,
3
),
59
:
(
-
23.5475
,
-
46.6361
,
-
3
),
19
:
(
-
33.8667
,
151.2167
,
10
),
20
:
(
35.70
,
139.7667
,
9
),
# US Cities
22
:
(
35.0833
,
106.65
,
-
7
),
23
:
(
61.217
,
149.90
,
-
9
),
24
:
(
33.733
,
84.383
,
-
5
),
25
:
(
30.283
,
97.733
,
-
6
),
26
:
(
33.521
,
86.8025
,
-
6
),
27
:
(
46.817
,
100.783
,
-
6
),
28
:
(
42.35
,
71.05
,
-
5
),
29
:
(
40.125
,
105.237
,
-
7
),
30
:
(
41.85
,
87.65
,
-
6
),
31
:
(
32.46
,
96.47
,
-
6
),
32
:
(
39.733
,
104.983
,
-
7
),
33
:
(
42.333
,
83.05
,
-
5
),
34
:
(
21.30
,
157.85
,
-
10
),
35
:
(
29.75
,
95.35
,
-
6
),
36
:
(
39.767
,
86.15
,
-
5
),
37
:
(
32.283
,
90.183
,
-
6
),
38
:
(
39.083
,
94.567
,
-
6
),
39
:
(
34.05
,
118.233
,
-
8
),
40
:
(
43.11
,
88.10
,
-
6
),
41
:
(
25.767
,
80.183
,
-
5
),
42
:
(
44.967
,
93.25
,
-
6
),
43
:
(
29.95
,
90.067
,
-
6
),
44
:
(
40.7167
,
74.0167
,
-
5
),
45
:
(
35.483
,
97.533
,
-
6
),
46
:
(
39.95
,
75.15
,
-
5
),
47
:
(
33.433
,
112.067
,
-
7
),
48
:
(
40.433
,
79.9833
,
-
5
),
49
:
(
43.666
,
70.283
,
-
5
),
50
:
(
45.517
,
122.65
,
-
8
),
51
:
(
35.783
,
78.65
,
-
5
),
52
:
(
37.5667
,
77.450
,
-
5
),
53
:
(
38.6167
,
90.1833
,
-
6
),
54
:
(
32.7667
,
117.2167
,
-
8
),
55
:
(
37.7667
,
122.4167
,
-
8
),
56
:
(
47.60
,
122.3167
,
-
8
),
57
:
(
38.8833
,
77.0333
,
-
5
),
22
:
(
35.0833
,
-
106.65
,
-
7
),
23
:
(
61.217
,
-
149.90
,
-
9
),
24
:
(
33.733
,
-
84.383
,
-
5
),
25
:
(
30.283
,
-
97.733
,
-
6
),
26
:
(
33.521
,
-
86.8025
,
-
6
),
27
:
(
46.817
,
-
100.783
,
-
6
),
28
:
(
42.35
,
-
71.05
,
-
5
),
29
:
(
40.125
,
-
105.237
,
-
7
),
30
:
(
41.85
,
-
87.65
,
-
6
),
31
:
(
32.46
,
-
96.47
,
-
6
),
32
:
(
39.733
,
-
104.983
,
-
7
),
33
:
(
42.333
,
-
83.05
,
-
5
),
34
:
(
21.30
,
-
157.85
,
-
10
),
35
:
(
29.75
,
-
95.35
,
-
6
),
36
:
(
39.767
,
-
86.15
,
-
5
),
37
:
(
32.283
,
-
90.183
,
-
6
),
38
:
(
39.083
,
-
94.567
,
-
6
),
39
:
(
34.05
,
-
118.233
,
-
8
),
40
:
(
43.11
,
-
88.10
,
-
6
),
41
:
(
25.767
,
-
80.183
,
-
5
),
42
:
(
44.967
,
-
93.25
,
-
6
),
43
:
(
29.95
,
-
90.067
,
-
6
),
44
:
(
40.7167
,
-
74.0167
,
-
5
),
45
:
(
35.483
,
-
97.533
,
-
6
),
46
:
(
39.95
,
-
75.15
,
-
5
),
47
:
(
33.433
,
-
112.067
,
-
7
),
48
:
(
40.433
,
-
79.9833
,
-
5
),
49
:
(
43.666
,
-
70.283
,
-
5
),
50
:
(
45.517
,
-
122.65
,
-
8
),
51
:
(
35.783
,
-
78.65
,
-
5
),
52
:
(
37.5667
,
-
77.450
,
-
5
),
53
:
(
38.6167
,
-
90.1833
,
-
6
),
54
:
(
32.7667
,
-
117.2167
,
-
8
),
55
:
(
37.7667
,
-
122.4167
,
-
8
),
56
:
(
47.60
,
-
122.3167
,
-
8
),
57
:
(
38.8833
,
-
77.0333
,
-
5
),
}
# mathematical helpers
...
...
@@ -327,7 +327,7 @@ class sun_calculator(object):
azimuth
=
a
elevation
=
hR
return
azimuth
,
elevation
return
-
azimuth
,
elevation
# Addon classes
#-----------------------------------------------------------------------------
...
...
@@ -382,7 +382,7 @@ class OBJECT_OT_set_geographical_sun_pos(bpy.types.Operator):
-
GSP
.
tz
+
dst
)
context
.
object
.
rotation_euler
=
(
math
.
radians
(
90
-
el
),
0
,
math
.
radians
(
-
az
)
)
context
.
object
.
rotation_euler
=
(
math
.
radians
(
90
-
el
),
0
,
math
.
radians
(
az
)
)
return
{
'
FINISHED
'
}
except
Exception
as
err
:
self
.
report
({
'
ERROR
'
},
str
(
err
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment