1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Merge pull request #91599 from dnllowe/realtime-animation-player-property-updates

Update AnimationPlayer in real-time when keyframe properties change
This commit is contained in:
Rémi Verschelde
2024-08-30 23:37:42 +02:00
3 changed files with 45 additions and 0 deletions

View File

@@ -1413,6 +1413,12 @@ void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_timel
_seek_value_changed(p_pos, p_timeline_only);
}
void AnimationPlayerEditor::_animation_update_key_frame() {
if (player) {
player->advance(0);
}
}
void AnimationPlayerEditor::_animation_tool_menu(int p_option) {
String current = _get_current();
@@ -1874,6 +1880,7 @@ bool AnimationPlayerEditor::_validate_tracks(const Ref<Animation> p_anim) {
void AnimationPlayerEditor::_bind_methods() {
// Needed for UndoRedo.
ClassDB::bind_method(D_METHOD("_animation_player_changed"), &AnimationPlayerEditor::_animation_player_changed);
ClassDB::bind_method(D_METHOD("_animation_update_key_frame"), &AnimationPlayerEditor::_animation_update_key_frame);
ClassDB::bind_method(D_METHOD("_start_onion_skinning"), &AnimationPlayerEditor::_start_onion_skinning);
ClassDB::bind_method(D_METHOD("_stop_onion_skinning"), &AnimationPlayerEditor::_stop_onion_skinning);