mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 20:50:02 +00:00
animation settings now use human readable durations to make it less confusing
This commit is contained in:
@@ -412,9 +412,9 @@ class BIMWorkScheduleProperties(PropertyGroup):
|
|||||||
visualisation_start: StringProperty(name="Visualisation Start", update=update_visualisation_start)
|
visualisation_start: StringProperty(name="Visualisation Start", update=update_visualisation_start)
|
||||||
visualisation_finish: StringProperty(name="Visualisation Finish", update=update_visualisation_finish)
|
visualisation_finish: StringProperty(name="Visualisation Finish", update=update_visualisation_finish)
|
||||||
speed_multiplier: FloatProperty(name="Speed Multiplier", default=10000)
|
speed_multiplier: FloatProperty(name="Speed Multiplier", default=10000)
|
||||||
speed_animation_duration: StringProperty(name="Speed Animation Duration", default="PT1S")
|
speed_animation_duration: StringProperty(name="Speed Animation Duration", default="1 s")
|
||||||
speed_animation_frames: IntProperty(name="Speed Animation Frames", default=24)
|
speed_animation_frames: IntProperty(name="Speed Animation Frames", default=24)
|
||||||
speed_real_duration: StringProperty(name="Speed Real Duration", default="P1W")
|
speed_real_duration: StringProperty(name="Speed Real Duration", default="1 w")
|
||||||
speed_types: EnumProperty(
|
speed_types: EnumProperty(
|
||||||
items=[
|
items=[
|
||||||
("FRAME_SPEED", "Frame-based", "e.g. 25 frames = 1 real week"),
|
("FRAME_SPEED", "Frame-based", "e.g. 25 frames = 1 real week"),
|
||||||
|
|||||||
@@ -1226,21 +1226,23 @@ class Sequence(blenderbim.core.tool.Sequence):
|
|||||||
start,
|
start,
|
||||||
finish,
|
finish,
|
||||||
props.speed_animation_frames,
|
props.speed_animation_frames,
|
||||||
isodate.parse_duration(props.speed_real_duration),
|
ifcopenshell.util.date.parse_duration(props.speed_real_duration)
|
||||||
)
|
)
|
||||||
elif props.speed_types == "DURATION_SPEED":
|
elif props.speed_types == "DURATION_SPEED":
|
||||||
|
animation_duration = ifcopenshell.util.date.parse_duration(props.speed_animation_duration)
|
||||||
|
real_duration = ifcopenshell.util.date.parse_duration(props.speed_real_duration)
|
||||||
return calculate_using_duration(
|
return calculate_using_duration(
|
||||||
start,
|
start,
|
||||||
finish,
|
finish,
|
||||||
fps,
|
fps,
|
||||||
isodate.parse_duration(props.speed_animation_duration),
|
animation_duration,
|
||||||
isodate.parse_duration(props.speed_real_duration),
|
real_duration,
|
||||||
)
|
)
|
||||||
elif props.speed_types == "MULTIPLIER_SPEED":
|
elif props.speed_types == "MULTIPLIER_SPEED":
|
||||||
return calculate_using_multiplier(
|
return calculate_using_multiplier(
|
||||||
start,
|
start,
|
||||||
finish,
|
finish,
|
||||||
fps,
|
1,
|
||||||
props.speed_multiplier,
|
props.speed_multiplier,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ Scenario: See the current frame date as text
|
|||||||
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "P1W"
|
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "1 w"
|
||||||
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
||||||
When I am on frame "1"
|
When I am on frame "1"
|
||||||
Then the object "Timeline" has a body of "2021-01-01"
|
Then the object "Timeline" has a body of "2021-01-01"
|
||||||
@@ -357,7 +357,7 @@ Scenario: Animate the construction of a wall
|
|||||||
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "P1W"
|
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "1 w"
|
||||||
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
||||||
When I am on frame "1"
|
When I am on frame "1"
|
||||||
Then "scene.objects.get('IfcWall/Cube').hide_viewport" is "True"
|
Then "scene.objects.get('IfcWall/Cube').hide_viewport" is "True"
|
||||||
@@ -393,7 +393,7 @@ Scenario: Animate the demolition of a wall
|
|||||||
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "P1W"
|
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "1 w"
|
||||||
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
||||||
When I am on frame "1"
|
When I am on frame "1"
|
||||||
Then "scene.objects.get('IfcWall/Cube').hide_viewport" is "False"
|
Then "scene.objects.get('IfcWall/Cube').hide_viewport" is "False"
|
||||||
@@ -432,7 +432,7 @@ Scenario: Animate the operation of a wall
|
|||||||
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "P1W"
|
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "1 w"
|
||||||
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
||||||
When I am on frame "1"
|
When I am on frame "1"
|
||||||
Then "scene.objects.get('IfcWall/Cube').color[:]" is "[1.0, 1.0, 1.0, 1]"
|
Then "scene.objects.get('IfcWall/Cube').color[:]" is "[1.0, 1.0, 1.0, 1]"
|
||||||
@@ -472,7 +472,7 @@ Scenario: Animate the movement of a wall
|
|||||||
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "P1W"
|
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "1 w"
|
||||||
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
||||||
When I am on frame "1"
|
When I am on frame "1"
|
||||||
Then "scene.objects.get('IfcWall/FromObject').color[:]" is "[1.0, 1.0, 1.0, 1]"
|
Then "scene.objects.get('IfcWall/FromObject').color[:]" is "[1.0, 1.0, 1.0, 1]"
|
||||||
@@ -516,7 +516,7 @@ Scenario: Animate the consumption of a wall
|
|||||||
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
And I set "scene.BIMWorkScheduleProperties.visualisation_finish" to "01/02/21"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
And I set "scene.BIMWorkScheduleProperties.speed_types" to "FRAME_SPEED"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
And I set "scene.BIMWorkScheduleProperties.speed_animation_frames" to "7"
|
||||||
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "P1W"
|
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "1 w"
|
||||||
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
|
||||||
When I am on frame "1"
|
When I am on frame "1"
|
||||||
Then "scene.objects.get('IfcWall/Cube').color[:]" is "[1.0, 1.0, 1.0, 1]"
|
Then "scene.objects.get('IfcWall/Cube').color[:]" is "[1.0, 1.0, 1.0, 1]"
|
||||||
|
|||||||
Reference in New Issue
Block a user