mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 01:00:56 +00:00
You can now set the viewport shadow from the sun angle, useful for shadow studies
This commit is contained in:
@@ -193,6 +193,7 @@ if bpy is not None:
|
|||||||
operator.SelectScheduleFile,
|
operator.SelectScheduleFile,
|
||||||
operator.BuildSchedule,
|
operator.BuildSchedule,
|
||||||
operator.AddScheduleToSheet,
|
operator.AddScheduleToSheet,
|
||||||
|
operator.SetViewportShadowFromSun,
|
||||||
prop.StrProperty,
|
prop.StrProperty,
|
||||||
prop.Variable,
|
prop.Variable,
|
||||||
prop.Role,
|
prop.Role,
|
||||||
|
|||||||
@@ -3831,3 +3831,17 @@ class AddScheduleToSheet(bpy.types.Operator):
|
|||||||
props.schedules[props.active_schedule_index].name,
|
props.schedules[props.active_schedule_index].name,
|
||||||
props.sheets[props.active_sheet_index].name)
|
props.sheets[props.active_sheet_index].name)
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
class SetViewportShadowFromSun(bpy.types.Operator):
|
||||||
|
bl_idname = 'bim.set_viewport_shadow_from_sun'
|
||||||
|
bl_label = 'Set Viewport Shadow from Sun'
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
# The vector used for the light direction is a bit funny
|
||||||
|
mat = Matrix(((-1.0, 0.0, 0.0, 0.0),
|
||||||
|
(0.0, 0, 1.0, 0.0),
|
||||||
|
(-0.0, -1.0, 0, 0.0),
|
||||||
|
(0.0, 0.0, 0.0, 1.0)))
|
||||||
|
context.scene.display.light_direction = mat.inverted() @ (context.active_object.matrix_world.to_quaternion() @ Vector((0,0,-1)))
|
||||||
|
return {'FINISHED'}
|
||||||
|
|||||||
@@ -1988,6 +1988,8 @@ class BIM_PT_misc_utilities(Panel):
|
|||||||
row.prop(props, 'override_colour', text='')
|
row.prop(props, 'override_colour', text='')
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.operator("bim.set_override_colour")
|
row.operator("bim.set_override_colour")
|
||||||
|
row = layout.row(align=True)
|
||||||
|
row.operator("bim.set_viewport_shadow_from_sun")
|
||||||
|
|
||||||
|
|
||||||
def ifc_units(self, context):
|
def ifc_units(self, context):
|
||||||
|
|||||||
Reference in New Issue
Block a user