diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-04-30 18:31:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-30 18:31:41 +0200 |
commit | 537b1fbbba1d19565fbc00112c89cbcfdaf2c684 (patch) | |
tree | 31e686595ed4922e87706afde05e9624c08da798 /editor/animation_track_editor.cpp | |
parent | c1cc438ce6be5dbbe21588d28c765c6ab2996a19 (diff) | |
parent | a7ef836c69b21ab69346a9895f873cfbfce4a74b (diff) |
Merge pull request #27954 from sketchyfun/bezier_fixes
Enhancements and fixes for the bezier animation track editor
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r-- | editor/animation_track_editor.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 4dff7d5b69..61244ab78c 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -309,8 +309,8 @@ public: setting = true; undo_redo->create_action(TTR("Anim Change Keyframe Value"), UndoRedo::MERGE_ENDS); Vector2 prev = animation->bezier_track_get_key_in_handle(track, key); - undo_redo->add_do_method(animation.ptr(), "bezier_track_set_in_handle", track, key, value); - undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_in_handle", track, key, prev); + undo_redo->add_do_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, value); + undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, prev); undo_redo->add_do_method(this, "_update_obj", animation); undo_redo->add_undo_method(this, "_update_obj", animation); undo_redo->commit_action(); @@ -325,8 +325,8 @@ public: setting = true; undo_redo->create_action(TTR("Anim Change Keyframe Value"), UndoRedo::MERGE_ENDS); Vector2 prev = animation->bezier_track_get_key_out_handle(track, key); - undo_redo->add_do_method(animation.ptr(), "bezier_track_set_out_handle", track, key, value); - undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_out_handle", track, key, prev); + undo_redo->add_do_method(animation.ptr(), "bezier_track_set_key_out_handle", track, key, value); + undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_out_handle", track, key, prev); undo_redo->add_do_method(this, "_update_obj", animation); undo_redo->add_undo_method(this, "_update_obj", animation); undo_redo->commit_action(); @@ -1274,13 +1274,7 @@ void AnimationTrackEdit::_notification(int p_what) { } else if (animation->track_get_type(track) == Animation::TYPE_ANIMATION) { text = TTR("Anim Clips:"); } else { - Vector<StringName> sn = path.get_subnames(); - for (int i = 0; i < sn.size(); i++) { - if (i > 0) { - text += "."; - } - text += sn[i]; - } + text += path.get_concatenated_subnames(); } text_color.a *= 0.7; } else if (node) { @@ -1294,14 +1288,10 @@ void AnimationTrackEdit::_notification(int p_what) { draw_texture(icon, Point2(ofs, int(get_size().height - icon->get_height()) / 2)); icon_cache = icon; - text = node->get_name(); + text = String() + node->get_name() + ":" + path.get_concatenated_subnames(); ofs += hsep; ofs += icon->get_width(); - Vector<StringName> sn = path.get_subnames(); - for (int i = 0; i < sn.size(); i++) { - text += "."; - text += sn[i]; - } + } else { icon_cache = type_icon; @@ -3536,7 +3526,10 @@ void AnimationTrackEditor::_animation_changed() { if (key_edit && key_edit->setting) { //if editing a key, just update the edited track, makes refresh less costly if (key_edit->track < track_edits.size()) { - track_edits[key_edit->track]->update(); + if (animation->track_get_type(key_edit->track) == Animation::TYPE_BEZIER) + bezier_edit->update(); + else + track_edits[key_edit->track]->update(); } return; } |