BBIM: Disable "Create animation" buttons when no start dates/end dates are given

This commit is contained in:
Sigma Dimensions
2023-01-05 18:36:22 +01:00
parent 839a00c2a8
commit cd6f995471
@@ -1024,6 +1024,10 @@ class VisualiseWorkScheduleDate(bpy.types.Operator):
bl_options = {"REGISTER", "UNDO"}
work_schedule: bpy.props.IntProperty()
@classmethod
def poll(cls, context):
return bool(bpy.context.scene.BIMWorkScheduleProperties.visualisation_start)
def execute(self, context):
props = context.scene.BIMWorkScheduleProperties
self.file = IfcStore.get_file()
@@ -1090,6 +1094,11 @@ class VisualiseWorkScheduleDateRange(bpy.types.Operator):
bl_options = {"REGISTER", "UNDO"}
work_schedule: bpy.props.IntProperty()
@classmethod
def poll(cls, context):
has_start, has_finish = bpy.context.scene.BIMWorkScheduleProperties.visualisation_start, bpy.context.scene.BIMWorkScheduleProperties.visualisation_finish
return bool(has_start and has_finish)
def execute(self, context):
core.visualise_work_schedule_date_range(tool.Sequence, work_schedule=tool.Ifc.get().by_id(self.work_schedule))
return {"FINISHED"}