mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
Fix Solar Analysis UI after changes in Sun Position Add-on.
Changes in this file: https://projects.blender.org/pioverfour/sun_position/src/branch/main/sun_calc.py
This commit is contained in:
@@ -144,16 +144,9 @@ class SolarDecorator:
|
|||||||
self.draw_batch("LINES", [location, origin @ Vector((0, 0, 0))], decorator_color_background, [[0, 1]])
|
self.draw_batch("LINES", [location, origin @ Vector((0, 0, 0))], decorator_color_background, [[0, 1]])
|
||||||
|
|
||||||
coords = []
|
coords = []
|
||||||
indices = []
|
analemma_verts, analemma_edges = SolarData.data["sun_position"].sun_calc.calc_analemma(context.scene)
|
||||||
coord_offset = 0
|
coords.extend([origin @ v for v in analemma_verts])
|
||||||
for h in range(24):
|
self.draw_batch("LINES", coords, decorator_color_special, analemma_edges)
|
||||||
analemma_verts = SolarData.data["sun_position"].sun_calc.calc_analemma(context, h)
|
|
||||||
coords.extend([origin @ v for v in analemma_verts])
|
|
||||||
for i in range(len(analemma_verts) - 1):
|
|
||||||
indices.append((coord_offset + i, coord_offset + i + 1))
|
|
||||||
coord_offset += len(analemma_verts)
|
|
||||||
|
|
||||||
self.draw_batch("LINES", coords, decorator_color_special, indices)
|
|
||||||
|
|
||||||
# True north
|
# True north
|
||||||
self.tn_angle = props.true_north
|
self.tn_angle = props.true_north
|
||||||
|
|||||||
@@ -216,8 +216,8 @@ class BIM_PT_solar(bpy.types.Panel):
|
|||||||
|
|
||||||
box = row.box()
|
box = row.box()
|
||||||
|
|
||||||
sunrise = sun_position.sun_calc.format_hms(sun_position.sun_calc.sun.sunrise)
|
sunrise = sun_position.sun_calc.format_hms(sun_props.sunrise_time)
|
||||||
sunset = sun_position.sun_calc.format_hms(sun_position.sun_calc.sun.sunset)
|
sunset = sun_position.sun_calc.format_hms(sun_props.sunset_time)
|
||||||
|
|
||||||
row2 = box.row()
|
row2 = box.row()
|
||||||
row2.label(text=f"Sunrise: {sunrise}")
|
row2.label(text=f"Sunrise: {sunrise}")
|
||||||
|
|||||||
Reference in New Issue
Block a user