diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-19 12:32:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-19 12:32:25 +0100 |
commit | 34f6572bdf0cd2d16d3ee9d265a4bc9e7acfb76f (patch) | |
tree | 6f1bc24fcbdaa823ce71301ae70165cc30519793 /editor/animation_track_editor.cpp | |
parent | 8b8e858778bbf9e0dad66335f351920332c547de (diff) | |
parent | 7e14548fc691be4a4602857a01966913c44b7000 (diff) |
Merge pull request #56940 from Faless/editor/4.x_keying_refactor
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r-- | editor/animation_track_editor.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 13e9d58744..973f74d6cc 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -3375,7 +3375,13 @@ Node *AnimationTrackEditor::get_root() const { } void AnimationTrackEditor::update_keying() { - bool keying_enabled = is_visible_in_tree() && animation.is_valid(); + bool keying_enabled = false; + + EditorHistory *editor_history = EditorNode::get_singleton()->get_editor_history(); + if (is_visible_in_tree() && animation.is_valid() && editor_history->get_path_size() > 0) { + Object *obj = ObjectDB::get_instance(editor_history->get_path_object(0)); + keying_enabled = Object::cast_to<Node>(obj) != nullptr; + } if (keying_enabled == keying) { return; @@ -4525,8 +4531,6 @@ void AnimationTrackEditor::_notification(int p_what) { if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { update_keying(); - EditorNode::get_singleton()->update_keying(); - emit_signal(SNAME("keying_changed")); } } |