mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Merge pull request #104371 from mihe/animation-player-reset
Fix issue of `AnimationPlayer` hiding bezier editor when re-selecting it
This commit is contained in:
commit
85d5df058b
1 changed files with 15 additions and 6 deletions
|
|
@ -4049,7 +4049,7 @@ void AnimationTrackEditor::set_animation(const Ref<Animation> &p_anim, bool p_re
|
||||||
marker_edit->set_animation(p_anim, read_only);
|
marker_edit->set_animation(p_anim, read_only);
|
||||||
marker_edit->set_play_position(timeline->get_play_position());
|
marker_edit->set_play_position(timeline->get_play_position());
|
||||||
|
|
||||||
_cancel_bezier_edit();
|
_check_bezier_exist();
|
||||||
_update_tracks();
|
_update_tracks();
|
||||||
|
|
||||||
if (animation.is_valid()) {
|
if (animation.is_valid()) {
|
||||||
|
|
@ -4078,7 +4078,14 @@ void AnimationTrackEditor::set_animation(const Ref<Animation> &p_anim, bool p_re
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_check_bezier_exist();
|
if (bezier_edit->is_visible()) {
|
||||||
|
for (int i = 0; i < animation->get_track_count(); ++i) {
|
||||||
|
if (animation->track_get_type(i) == Animation::TrackType::TYPE_BEZIER) {
|
||||||
|
_bezier_edit(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
hscroll->hide();
|
hscroll->hide();
|
||||||
edit->set_disabled(true);
|
edit->set_disabled(true);
|
||||||
|
|
@ -4099,10 +4106,12 @@ void AnimationTrackEditor::set_animation(const Ref<Animation> &p_anim, bool p_re
|
||||||
|
|
||||||
void AnimationTrackEditor::_check_bezier_exist() {
|
void AnimationTrackEditor::_check_bezier_exist() {
|
||||||
bool is_exist = false;
|
bool is_exist = false;
|
||||||
for (int i = 0; i < animation->get_track_count(); i++) {
|
if (animation.is_valid()) {
|
||||||
if (animation->track_get_type(i) == Animation::TrackType::TYPE_BEZIER) {
|
for (int i = 0; i < animation->get_track_count(); i++) {
|
||||||
is_exist = true;
|
if (animation->track_get_type(i) == Animation::TrackType::TYPE_BEZIER) {
|
||||||
break;
|
is_exist = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_exist) {
|
if (is_exist) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue