feat: Kufenspur blendet am Kuer-Ende aus
- Trail-Fade in Echtzeit, wenn die Wiedergabe endet und die Figur steht - Pausieren mitten in der Kuer laesst die Spur weiterhin stehen - Controller synchronisiert den Fade bei Play/Pause/Seek/Ende - 57 Praesentations-Assertions (1186 gesamt)
This commit is contained in:
parent
1530914814
commit
e79fa9635b
9 changed files with 131 additions and 15 deletions
|
|
@ -20,6 +20,8 @@ func _capture() -> void:
|
|||
var output := args[2] if args.size() > 2 else "user://capture_3d.png"
|
||||
var seek_time := float(args[3]) if args.size() > 3 else 4.0
|
||||
var camera_mode := args[4] if args.size() > 4 else "follow"
|
||||
var fade_wait := float(args[5]) if args.size() > 5 else 0.0
|
||||
var with_marker := not (args.size() > 6 and args[6] == "no-marker")
|
||||
|
||||
var controller := WhiteboardScene.instantiate() as WhiteboardController
|
||||
controller.restore_autosave = false
|
||||
|
|
@ -48,12 +50,13 @@ func _capture() -> void:
|
|||
PathSegment.Direction.BACKWARD,
|
||||
PathSegment.Edge.OUTSIDE
|
||||
)
|
||||
controller.add_element_marker(
|
||||
Vector2(4.0, 8.0),
|
||||
PathSegment.ElementType.SPIN,
|
||||
"CCoSp4",
|
||||
3
|
||||
)
|
||||
if with_marker:
|
||||
controller.add_element_marker(
|
||||
Vector2(4.0, 8.0),
|
||||
PathSegment.ElementType.SPIN,
|
||||
"CCoSp4",
|
||||
3
|
||||
)
|
||||
|
||||
controller.open_3d_view()
|
||||
if camera_mode == "overview":
|
||||
|
|
@ -67,6 +70,8 @@ func _capture() -> void:
|
|||
controller.pause()
|
||||
await process_frame
|
||||
await process_frame
|
||||
if fade_wait > 0.0:
|
||||
await create_timer(fade_wait).timeout
|
||||
|
||||
var presentation := controller.get_presentation_3d()
|
||||
print(
|
||||
|
|
@ -81,7 +86,9 @@ func _capture() -> void:
|
|||
"TRAIL ",
|
||||
presentation.trail.get_sample_count(),
|
||||
" ",
|
||||
presentation.trail.get_last_color()
|
||||
presentation.trail.get_last_color(),
|
||||
" fading ",
|
||||
presentation.trail.is_fading()
|
||||
)
|
||||
|
||||
var image := root.get_texture().get_image()
|
||||
|
|
|
|||
|
|
@ -157,6 +157,23 @@ func _test_presentation() -> void:
|
|||
"backward trail is orange"
|
||||
)
|
||||
|
||||
presentation.trail.start_fade()
|
||||
_check(presentation.trail.is_fading(), "the trail can fade out")
|
||||
presentation.trail._process(2.0)
|
||||
_check(
|
||||
presentation.trail.get_sample_count() == 0,
|
||||
"the trail fades out when the skater stands"
|
||||
)
|
||||
presentation.update_pose(
|
||||
Vector2(3.0, 0.0),
|
||||
Vector2.RIGHT,
|
||||
forward_segment
|
||||
)
|
||||
_check(
|
||||
not presentation.trail.is_fading(),
|
||||
"new movement stops the fade"
|
||||
)
|
||||
|
||||
presentation.update_pose(
|
||||
Vector2(20.0, 0.0),
|
||||
Vector2.RIGHT,
|
||||
|
|
@ -240,6 +257,15 @@ func _test_controller() -> void:
|
|||
"camera button switches the camera mode"
|
||||
)
|
||||
|
||||
controller.seek_playback(maxf(duration - 0.05, 0.0))
|
||||
controller.play()
|
||||
controller.advance_playback(1.0)
|
||||
_check(not controller.is_playing(), "playback stops at the end")
|
||||
_check(
|
||||
presentation.trail.is_fading(),
|
||||
"trail fades after the program ends"
|
||||
)
|
||||
|
||||
controller.close_3d_view()
|
||||
_check(not controller.is_3d_view_active(), "3D view closes")
|
||||
_check(controller.view_3d_button.text == "3D", "toolbar returns to 3D action")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue