mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Light UI - detect Sun Position addon activation/deactivation more reliably
This commit is contained in:
@@ -146,10 +146,17 @@ class BIM_PT_solar(bpy.types.Panel):
|
||||
SolarData.load()
|
||||
|
||||
assert self.layout
|
||||
if (sun_position := SolarData.data["sun_position"]) is None:
|
||||
|
||||
# Props are more reliable as they'll come and go regardless of Data update.
|
||||
if (sun_props := tool.Blender.get_sun_props()) is None:
|
||||
self.layout.label(text="Enable 'Sun Position' Add-on To Continue", icon="ERROR")
|
||||
return
|
||||
|
||||
sun_position = SolarData.data["sun_position"]
|
||||
if sun_position is None:
|
||||
# There are props, so there must be an addon.
|
||||
SolarData.data["sun_position"] = SolarData.sun_position()
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import sun_position
|
||||
|
||||
@@ -163,8 +170,6 @@ class BIM_PT_solar(bpy.types.Panel):
|
||||
row = self.layout.row(align=True)
|
||||
row.label(text="No Sites With Lat/Longs Found", icon="ERROR")
|
||||
|
||||
sun_props = tool.Blender.get_sun_props()
|
||||
|
||||
row = self.layout.row(align=True)
|
||||
row.alignment = "RIGHT"
|
||||
row.operator("bim.light_pick_coordinates", icon="URL", text="Pick")
|
||||
|
||||
Reference in New Issue
Block a user