mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 22:50:56 +00:00
Blender 5.0 - fix error enabling Rendered mode in Solar Analysis
This commit is contained in:
@@ -96,9 +96,10 @@ def update_shadow_mode(self: "BIMSolarProperties", context: bpy.types.Context) -
|
|||||||
sun_props = tool.Blender.get_sun_props()
|
sun_props = tool.Blender.get_sun_props()
|
||||||
assert sun_props
|
assert sun_props
|
||||||
if sun_props.sun_object is None:
|
if sun_props.sun_object is None:
|
||||||
bpy.ops.object.light_add(type="SUN", radius=1, align="WORLD", location=(0, 0, 0), scale=(1, 1, 1))
|
light = bpy.data.lights.new(name="Sun", type="SUN")
|
||||||
bpy.ops.object.move_to_collection(collection_index=0)
|
sun = bpy.data.objects.new("Sun", light)
|
||||||
sun_props.sun_object = bpy.context.active_object
|
context.scene.collection.objects.link(sun)
|
||||||
|
sun_props.sun_object = sun
|
||||||
update_sun_path(self)
|
update_sun_path(self)
|
||||||
context.scene.render.engine = "BLENDER_EEVEE_NEXT"
|
context.scene.render.engine = "BLENDER_EEVEE_NEXT"
|
||||||
assert context.scene.display
|
assert context.scene.display
|
||||||
|
|||||||
Reference in New Issue
Block a user