mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix seeking Animation immediate after playback for Discrete track
This commit is contained in:
parent
e96ad5af98
commit
bea47d877b
8 changed files with 47 additions and 31 deletions
|
@ -243,12 +243,12 @@ void AnimationPlayerEditor::_play_from_pressed() {
|
|||
String current = _get_current();
|
||||
|
||||
if (!current.is_empty()) {
|
||||
float time = player->get_current_animation_position();
|
||||
double time = player->get_current_animation_position();
|
||||
if (current == player->get_assigned_animation() && player->is_playing()) {
|
||||
player->stop(); //so it won't blend with itself
|
||||
player->clear_caches(); //so it won't blend with itself
|
||||
}
|
||||
ERR_FAIL_COND_EDMSG(!_validate_tracks(player->get_animation(current)), "Animation tracks may have any invalid key, abort playing.");
|
||||
player->seek(time);
|
||||
player->seek(time, true, true);
|
||||
player->play(current);
|
||||
}
|
||||
|
||||
|
@ -281,12 +281,12 @@ void AnimationPlayerEditor::_play_bw_from_pressed() {
|
|||
String current = _get_current();
|
||||
|
||||
if (!current.is_empty()) {
|
||||
float time = player->get_current_animation_position();
|
||||
if (current == player->get_assigned_animation()) {
|
||||
player->stop(); //so it won't blend with itself
|
||||
double time = player->get_current_animation_position();
|
||||
if (current == player->get_assigned_animation() && player->is_playing()) {
|
||||
player->clear_caches(); //so it won't blend with itself
|
||||
}
|
||||
ERR_FAIL_COND_EDMSG(!_validate_tracks(player->get_animation(current)), "Animation tracks may have any invalid key, abort playing.");
|
||||
player->seek(time);
|
||||
player->seek(time, true, true);
|
||||
player->play_backwards(current);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue