diff --git a/src/blenderbim/blenderbim/bim/module/sequence/prop.py b/src/blenderbim/blenderbim/bim/module/sequence/prop.py index ef4eff3de4..28a77506b4 100644 --- a/src/blenderbim/blenderbim/bim/module/sequence/prop.py +++ b/src/blenderbim/blenderbim/bim/module/sequence/prop.py @@ -412,9 +412,9 @@ class BIMWorkScheduleProperties(PropertyGroup): visualisation_start: StringProperty(name="Visualisation Start", update=update_visualisation_start) visualisation_finish: StringProperty(name="Visualisation Finish", update=update_visualisation_finish) 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_real_duration: StringProperty(name="Speed Real Duration", default="P1W") + speed_real_duration: StringProperty(name="Speed Real Duration", default="1 w") speed_types: EnumProperty( items=[ ("FRAME_SPEED", "Frame-based", "e.g. 25 frames = 1 real week"), diff --git a/src/blenderbim/blenderbim/tool/sequence.py b/src/blenderbim/blenderbim/tool/sequence.py index 39fc55cc99..157f2a6df7 100644 --- a/src/blenderbim/blenderbim/tool/sequence.py +++ b/src/blenderbim/blenderbim/tool/sequence.py @@ -1226,21 +1226,23 @@ class Sequence(blenderbim.core.tool.Sequence): start, finish, 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": + 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( start, finish, fps, - isodate.parse_duration(props.speed_animation_duration), - isodate.parse_duration(props.speed_real_duration), + animation_duration, + real_duration, ) elif props.speed_types == "MULTIPLIER_SPEED": return calculate_using_multiplier( start, finish, - fps, + 1, props.speed_multiplier, ) diff --git a/src/blenderbim/test/bim/feature/sequence.feature b/src/blenderbim/test/bim/feature/sequence.feature index 1015ef660e..81e40d63fd 100644 --- a/src/blenderbim/test/bim/feature/sequence.feature +++ b/src/blenderbim/test/bim/feature/sequence.feature @@ -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.speed_types" to "FRAME_SPEED" 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})" When I am on frame "1" 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.speed_types" to "FRAME_SPEED" 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})" When I am on frame "1" 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.speed_types" to "FRAME_SPEED" 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})" When I am on frame "1" 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.speed_types" to "FRAME_SPEED" 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})" When I am on frame "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.speed_types" to "FRAME_SPEED" 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})" When I am on frame "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.speed_types" to "FRAME_SPEED" 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})" When I am on frame "1" Then "scene.objects.get('IfcWall/Cube').color[:]" is "[1.0, 1.0, 1.0, 1]"