1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Fixed a few issues with the bezier animation track editor, fixed the Travis CI errors, added TTR to bezier value labels and rounded them to 3 decimal points

This commit is contained in:
Ben Hickling
2019-04-30 10:29:18 +01:00
parent 7e0c97e73b
commit a7ef836c69
2 changed files with 44 additions and 37 deletions

View File

@@ -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;
}