summaryrefslogtreecommitdiff
path: root/editor/animation_track_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r--editor/animation_track_editor.cpp175
1 files changed, 101 insertions, 74 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 0ba45a596e..8807a01f64 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -45,18 +45,22 @@ class AnimationTrackKeyEdit : public Object {
public:
bool setting;
- bool hidden;
bool _hide_script_from_inspector() {
return true;
}
+ bool _dont_undo_redo() {
+ return true;
+ }
+
static void _bind_methods() {
ClassDB::bind_method("_update_obj", &AnimationTrackKeyEdit::_update_obj);
ClassDB::bind_method("_key_ofs_changed", &AnimationTrackKeyEdit::_key_ofs_changed);
ClassDB::bind_method("_hide_script_from_inspector", &AnimationTrackKeyEdit::_hide_script_from_inspector);
ClassDB::bind_method("get_root_path", &AnimationTrackKeyEdit::get_root_path);
+ ClassDB::bind_method("_dont_undo_redo", &AnimationTrackKeyEdit::_dont_undo_redo);
}
//PopupDialog *ke_dialog;
@@ -82,16 +86,13 @@ public:
void _update_obj(const Ref<Animation> &p_anim) {
if (setting)
return;
- if (hidden)
- return;
if (!(animation == p_anim))
return;
+
notify_change();
}
void _key_ofs_changed(const Ref<Animation> &p_anim, float from, float to) {
- if (hidden)
- return;
if (!(animation == p_anim))
return;
if (from != key_ofs)
@@ -131,7 +132,7 @@ public:
if (existing != -1) {
Variant v = animation->track_get_key_value(track, existing);
- float trans = animation->track_get_key_transition(track, existing);
+ trans = animation->track_get_key_transition(track, existing);
undo_redo->add_undo_method(animation.ptr(), "track_insert_key", track, new_time, v, trans);
}
@@ -168,6 +169,7 @@ public:
undo_redo->add_do_method(this, "_update_obj", animation);
undo_redo->add_undo_method(this, "_update_obj", animation);
undo_redo->commit_action();
+
setting = false;
return true;
@@ -191,6 +193,7 @@ public:
undo_redo->add_do_method(this, "_update_obj", animation);
undo_redo->add_undo_method(this, "_update_obj", animation);
undo_redo->commit_action();
+
setting = false;
return true;
}
@@ -267,6 +270,7 @@ public:
undo_redo->add_do_method(this, "_update_obj", animation);
undo_redo->add_undo_method(this, "_update_obj", animation);
undo_redo->commit_action();
+
setting = false;
if (change_notify_deserved)
notify_change();
@@ -286,6 +290,7 @@ public:
undo_redo->add_do_method(this, "_update_obj", animation);
undo_redo->add_undo_method(this, "_update_obj", animation);
undo_redo->commit_action();
+
setting = false;
return true;
}
@@ -301,6 +306,7 @@ public:
undo_redo->add_do_method(this, "_update_obj", animation);
undo_redo->add_undo_method(this, "_update_obj", animation);
undo_redo->commit_action();
+
setting = false;
return true;
}
@@ -316,6 +322,7 @@ public:
undo_redo->add_do_method(this, "_update_obj", animation);
undo_redo->add_undo_method(this, "_update_obj", animation);
undo_redo->commit_action();
+
setting = false;
return true;
}
@@ -335,6 +342,7 @@ public:
undo_redo->add_do_method(this, "_update_obj", animation);
undo_redo->add_undo_method(this, "_update_obj", animation);
undo_redo->commit_action();
+
setting = false;
return true;
}
@@ -350,6 +358,7 @@ public:
undo_redo->add_do_method(this, "_update_obj", animation);
undo_redo->add_undo_method(this, "_update_obj", animation);
undo_redo->commit_action();
+
setting = false;
return true;
}
@@ -365,6 +374,7 @@ public:
undo_redo->add_do_method(this, "_update_obj", animation);
undo_redo->add_undo_method(this, "_update_obj", animation);
undo_redo->commit_action();
+
setting = false;
return true;
}
@@ -374,12 +384,12 @@ public:
if (name == "animation") {
- StringName name = p_value;
+ StringName anim_name = p_value;
setting = true;
undo_redo->create_action(TTR("Anim Change Keyframe Value"), UndoRedo::MERGE_ENDS);
StringName prev = animation->animation_track_get_key_animation(track, key);
- undo_redo->add_do_method(animation.ptr(), "animation_track_set_key_animation", track, key, name);
+ undo_redo->add_do_method(animation.ptr(), "animation_track_set_key_animation", track, key, anim_name);
undo_redo->add_undo_method(animation.ptr(), "animation_track_set_key_animation", track, key, prev);
undo_redo->add_do_method(this, "_update_obj", animation);
undo_redo->add_undo_method(this, "_update_obj", animation);
@@ -649,7 +659,6 @@ public:
}
AnimationTrackKeyEdit() {
- hidden = true;
key_ofs = 0;
track = -1;
setting = false;
@@ -683,12 +692,10 @@ void AnimationTimelineEdit::_anim_length_changed(double p_new_len) {
p_new_len = MAX(0.001, p_new_len);
editing = true;
- *block_animation_update_ptr = true;
- undo_redo->create_action("Change animation length");
+ undo_redo->create_action(TTR("Change Animation Length"));
undo_redo->add_do_method(animation.ptr(), "set_length", p_new_len);
undo_redo->add_undo_method(animation.ptr(), "set_length", animation->get_length());
undo_redo->commit_action();
- *block_animation_update_ptr = false;
editing = false;
update();
@@ -697,12 +704,10 @@ void AnimationTimelineEdit::_anim_length_changed(double p_new_len) {
void AnimationTimelineEdit::_anim_loop_pressed() {
- *block_animation_update_ptr = true;
- undo_redo->create_action("Change animation loop");
+ undo_redo->create_action(TTR("Change Animation Loop"));
undo_redo->add_do_method(animation.ptr(), "set_loop", loop->is_pressed());
undo_redo->add_undo_method(animation.ptr(), "set_loop", animation->has_loop());
undo_redo->commit_action();
- *block_animation_update_ptr = false;
}
int AnimationTimelineEdit::get_buttons_width() const {
@@ -927,10 +932,6 @@ Size2 AnimationTimelineEdit::get_minimum_size() const {
return ms;
}
-void AnimationTimelineEdit::set_block_animation_update_ptr(bool *p_block_ptr) {
- block_animation_update_ptr = p_block_ptr;
-}
-
void AnimationTimelineEdit::set_undo_redo(UndoRedo *p_undo_redo) {
undo_redo = p_undo_redo;
}
@@ -1071,7 +1072,6 @@ void AnimationTimelineEdit::_bind_methods() {
AnimationTimelineEdit::AnimationTimelineEdit() {
- block_animation_update_ptr = NULL;
editing = false;
name_limit = 150;
zoom = NULL;
@@ -1621,10 +1621,15 @@ void AnimationTrackEdit::set_animation_and_track(const Ref<Animation> &p_animati
ERR_FAIL_INDEX(track, animation->get_track_count());
+ node_path = animation->track_get_path(p_track);
type_icon = type_icons[animation->track_get_type(track)];
selected_icon = get_icon("KeySelected", "EditorIcons");
}
+NodePath AnimationTrackEdit::get_path() const {
+ return node_path;
+}
+
Size2 AnimationTrackEdit::get_minimum_size() const {
Ref<Texture> texture = get_icon("Object", "EditorIcons");
@@ -1685,7 +1690,7 @@ void AnimationTrackEdit::_zoom_changed() {
}
void AnimationTrackEdit::_path_entered(const String &p_text) {
- undo_redo->create_action("Change Track Path");
+ undo_redo->create_action(TTR("Change Track Path"));
undo_redo->add_do_method(animation.ptr(), "track_set_path", track, p_text);
undo_redo->add_undo_method(animation.ptr(), "track_set_path", track, animation->track_get_path(track));
undo_redo->commit_action();
@@ -1875,12 +1880,10 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
Point2 pos = mb->get_position();
if (check_rect.has_point(pos)) {
- *block_animation_update_ptr = true;
- undo_redo->create_action("Toggle track enabled");
+ undo_redo->create_action(TTR("Toggle Track Enabled"));
undo_redo->add_do_method(animation.ptr(), "track_set_enabled", track, !animation->track_is_enabled(track));
undo_redo->add_undo_method(animation.ptr(), "track_set_enabled", track, animation->track_is_enabled(track));
undo_redo->commit_action();
- *block_animation_update_ptr = false;
update();
accept_event();
}
@@ -1947,6 +1950,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
if (remove_rect.has_point(pos)) {
emit_signal("remove_request", track);
accept_event();
+ return;
}
if (bezier_edit_rect.has_point(pos)) {
@@ -2177,12 +2181,10 @@ void AnimationTrackEdit::_menu_selected(int p_index) {
case MENU_CALL_MODE_CAPTURE: {
Animation::UpdateMode update_mode = Animation::UpdateMode(p_index);
- *block_animation_update_ptr = true;
- undo_redo->create_action("Change animation update mode");
+ undo_redo->create_action(TTR("Change Animation Update Mode"));
undo_redo->add_do_method(animation.ptr(), "value_track_set_update_mode", track, update_mode);
undo_redo->add_undo_method(animation.ptr(), "value_track_set_update_mode", track, animation->value_track_get_update_mode(track));
undo_redo->commit_action();
- *block_animation_update_ptr = false;
update();
} break;
@@ -2191,24 +2193,20 @@ void AnimationTrackEdit::_menu_selected(int p_index) {
case MENU_INTERPOLATION_CUBIC: {
Animation::InterpolationType interp_mode = Animation::InterpolationType(p_index - MENU_INTERPOLATION_NEAREST);
- *block_animation_update_ptr = true;
- undo_redo->create_action("Change animation interpolation mode");
+ undo_redo->create_action(TTR("Change Animation Interpolation Mode"));
undo_redo->add_do_method(animation.ptr(), "track_set_interpolation_type", track, interp_mode);
undo_redo->add_undo_method(animation.ptr(), "track_set_interpolation_type", track, animation->track_get_interpolation_type(track));
undo_redo->commit_action();
- *block_animation_update_ptr = false;
update();
} break;
case MENU_LOOP_WRAP:
case MENU_LOOP_CLAMP: {
bool loop_wrap = p_index == MENU_LOOP_WRAP;
- *block_animation_update_ptr = true;
- undo_redo->create_action("Change animation loop mode");
+ undo_redo->create_action(TTR("Change Animation Loop Mode"));
undo_redo->add_do_method(animation.ptr(), "track_set_interpolation_loop_wrap", track, loop_wrap);
undo_redo->add_undo_method(animation.ptr(), "track_set_interpolation_loop_wrap", track, animation->track_get_interpolation_loop_wrap(track));
undo_redo->commit_action();
- *block_animation_update_ptr = false;
update();
} break;
@@ -2226,10 +2224,6 @@ void AnimationTrackEdit::_menu_selected(int p_index) {
}
}
-void AnimationTrackEdit::set_block_animation_update_ptr(bool *p_block_ptr) {
- block_animation_update_ptr = p_block_ptr;
-}
-
void AnimationTrackEdit::cancel_drop() {
if (dropping_at != 0) {
dropping_at = 0;
@@ -2292,7 +2286,6 @@ AnimationTrackEdit::AnimationTrackEdit() {
root = NULL;
path = NULL;
menu = NULL;
- block_animation_update_ptr = NULL;
clicking_on_name = false;
dropping_at = 0;
@@ -2546,7 +2539,10 @@ void AnimationTrackEditor::_track_remove_request(int p_track) {
int idx = p_track;
if (idx >= 0 && idx < animation->get_track_count()) {
- _clear_selection();
+ selection.clear();
+ _clear_key_edit();
+ //all will be updated after remove anyway, and triggering update here raises error on tracks already removed
+
undo_redo->create_action(TTR("Remove Anim Track"));
undo_redo->add_do_method(animation.ptr(), "remove_track", idx);
undo_redo->add_undo_method(animation.ptr(), "add_track", animation->track_get_type(idx), idx);
@@ -2824,9 +2820,9 @@ void AnimationTrackEditor::insert_node_value_key(Node *p_node, const String &p_p
if (animation->track_get_path(i) == np) {
value = p_value; //all good
} else {
- String path = animation->track_get_path(i);
- if (NodePath(path.get_basename()) == np) {
- String subindex = path.get_extension();
+ String tpath = animation->track_get_path(i);
+ if (NodePath(tpath.get_basename()) == np) {
+ String subindex = tpath.get_extension();
value = p_value.get(subindex);
} else {
continue;
@@ -2919,9 +2915,9 @@ void AnimationTrackEditor::insert_value_key(const String &p_property, const Vari
if (animation->track_get_path(i) == np) {
value = p_value; //all good
} else {
- String path = animation->track_get_path(i);
- if (NodePath(path.get_basename()) == np) {
- String subindex = path.get_extension();
+ String tpath = animation->track_get_path(i);
+ if (NodePath(tpath.get_basename()) == np) {
+ String subindex = tpath.get_extension();
value = p_value.get(subindex);
} else {
continue;
@@ -3209,14 +3205,6 @@ int AnimationTrackEditor::_confirm_insert(InsertData p_id, int p_last_track, boo
}
}
- /*
- undo_redo->add_do_method(this, "update_tracks");
- undo_redo->add_undo_method(this, "update");
- undo_redo->add_do_method(track_editor, "update");
- undo_redo->add_undo_method(track_editor, "update");
- undo_redo->add_do_method(track_pos, "update");
- undo_redo->add_undo_method(track_pos, "update");
-*/
undo_redo->commit_action();
return p_last_track;
@@ -3383,7 +3371,6 @@ void AnimationTrackEditor::_update_tracks() {
track_edit->set_undo_redo(undo_redo);
track_edit->set_timeline(timeline);
- track_edit->set_block_animation_update_ptr(&block_animation_update);
track_edit->set_root(root);
track_edit->set_animation_and_track(animation, i);
track_edit->set_play_position(timeline->get_play_position());
@@ -3414,9 +3401,47 @@ void AnimationTrackEditor::_update_tracks() {
void AnimationTrackEditor::_animation_changed() {
+ if (animation_changing_awaiting_update) {
+ return; //all will be updated, dont bother with anything
+ }
+
+ 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();
+ }
+ return;
+ }
+
+ animation_changing_awaiting_update = true;
+ call_deferred("_animation_update");
+}
+
+void AnimationTrackEditor::_animation_update() {
+
timeline->update();
timeline->update_values();
- if (block_animation_update) {
+
+ bool same = true;
+
+ if (animation.is_null()) {
+ return;
+ }
+
+ if (track_edits.size() == animation->get_track_count()) {
+ //check tracks are the same
+
+ for (int i = 0; i < track_edits.size(); i++) {
+ if (track_edits[i]->get_path() != animation->track_get_path(i)) {
+ same = false;
+ break;
+ }
+ }
+ } else {
+ same = false;
+ }
+
+ if (same) {
for (int i = 0; i < track_edits.size(); i++) {
track_edits[i]->update();
}
@@ -3432,6 +3457,8 @@ void AnimationTrackEditor::_animation_changed() {
step->set_block_signals(true);
step->set_value(animation->get_step());
step->set_block_signals(false);
+
+ animation_changing_awaiting_update = false;
}
MenuButton *AnimationTrackEditor::get_edit_menu() {
@@ -3469,7 +3496,7 @@ void AnimationTrackEditor::_update_scroll(double) {
void AnimationTrackEditor::_update_step(double p_new_step) {
- undo_redo->create_action("Change animation step");
+ undo_redo->create_action(TTR("Change Animation Step"));
undo_redo->add_do_method(animation.ptr(), "set_step", p_new_step);
undo_redo->add_undo_method(animation.ptr(), "set_step", animation->get_step());
step->set_block_signals(true);
@@ -3492,7 +3519,7 @@ void AnimationTrackEditor::_dropped_track(int p_from_track, int p_to_track) {
return;
_clear_selection();
- undo_redo->create_action("Rearrange tracks");
+ undo_redo->create_action(TTR("Rearrange Tracks"));
undo_redo->add_do_method(animation.ptr(), "track_swap", p_from_track, p_to_track);
undo_redo->add_undo_method(animation.ptr(), "track_swap", p_to_track, p_from_track);
undo_redo->commit_action();
@@ -3519,7 +3546,7 @@ void AnimationTrackEditor::_new_track_node_selected(NodePath p_path) {
case Animation::TYPE_TRANSFORM:
case Animation::TYPE_METHOD: {
- undo_redo->create_action("Add Track");
+ undo_redo->create_action(TTR("Add Track"));
undo_redo->add_do_method(animation.ptr(), "add_track", adding_track_type);
undo_redo->add_do_method(animation.ptr(), "track_set_path", animation->get_track_count(), path_to);
undo_redo->add_undo_method(animation.ptr(), "remove_track", animation->get_track_count());
@@ -3548,7 +3575,7 @@ void AnimationTrackEditor::_new_track_node_selected(NodePath p_path) {
return;
}
- undo_redo->create_action("Add Track");
+ undo_redo->create_action(TTR("Add Track"));
undo_redo->add_do_method(animation.ptr(), "add_track", adding_track_type);
undo_redo->add_do_method(animation.ptr(), "track_set_path", animation->get_track_count(), path_to);
undo_redo->add_undo_method(animation.ptr(), "remove_track", animation->get_track_count());
@@ -3567,7 +3594,7 @@ void AnimationTrackEditor::_new_track_node_selected(NodePath p_path) {
return;
}
- undo_redo->create_action("Add Track");
+ undo_redo->create_action(TTR("Add Track"));
undo_redo->add_do_method(animation.ptr(), "add_track", adding_track_type);
undo_redo->add_do_method(animation.ptr(), "track_set_path", animation->get_track_count(), path_to);
undo_redo->add_undo_method(animation.ptr(), "remove_track", animation->get_track_count());
@@ -3619,7 +3646,7 @@ void AnimationTrackEditor::_new_track_property_selected(String p_name) {
}
}
- undo_redo->create_action("Add Track");
+ undo_redo->create_action(TTR("Add Track"));
undo_redo->add_do_method(animation.ptr(), "add_track", adding_track_type);
undo_redo->add_do_method(animation.ptr(), "track_set_path", animation->get_track_count(), full_path);
undo_redo->add_do_method(animation.ptr(), "value_track_set_update_mode", animation->get_track_count(), update_mode);
@@ -3642,7 +3669,7 @@ void AnimationTrackEditor::_new_track_property_selected(String p_name) {
}
}
- undo_redo->create_action("Add Bezier Track");
+ undo_redo->create_action(TTR("Add Bezier Track"));
int base_track = animation->get_track_count();
for (int i = 0; i < subindices.size(); i++) {
undo_redo->add_do_method(animation.ptr(), "add_track", adding_track_type);
@@ -3710,7 +3737,7 @@ void AnimationTrackEditor::_insert_key_from_track(float p_ofs, int p_track) {
Vector3 scale = xf.basis.get_scale_local();
Quat rot = xf.basis;
- undo_redo->create_action("Add Transform Track Key");
+ undo_redo->create_action(TTR("Add Transform Track Key"));
undo_redo->add_do_method(animation.ptr(), "transform_track_insert_key", p_track, p_ofs, loc, rot, scale);
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", p_track, p_ofs);
undo_redo->commit_action();
@@ -3722,7 +3749,7 @@ void AnimationTrackEditor::_insert_key_from_track(float p_ofs, int p_track) {
Variant value;
_find_hint_for_track(p_track, bp, &value);
- undo_redo->create_action("Add Track Key");
+ undo_redo->create_action(TTR("Add Track Key"));
undo_redo->add_do_method(animation.ptr(), "track_insert_key", p_track, p_ofs, value);
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", p_track, p_ofs);
undo_redo->commit_action();
@@ -3754,7 +3781,7 @@ void AnimationTrackEditor::_insert_key_from_track(float p_ofs, int p_track) {
arr[3] = 0.25;
arr[4] = 0;
- undo_redo->create_action("Add Track Key");
+ undo_redo->create_action(TTR("Add Track Key"));
undo_redo->add_do_method(animation.ptr(), "track_insert_key", p_track, p_ofs, arr);
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", p_track, p_ofs);
undo_redo->commit_action();
@@ -3767,7 +3794,7 @@ void AnimationTrackEditor::_insert_key_from_track(float p_ofs, int p_track) {
ak["start_offset"] = 0;
ak["end_offset"] = 0;
- undo_redo->create_action("Add Track Key");
+ undo_redo->create_action(TTR("Add Track Key"));
undo_redo->add_do_method(animation.ptr(), "track_insert_key", p_track, p_ofs, ak);
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", p_track, p_ofs);
undo_redo->commit_action();
@@ -3776,7 +3803,7 @@ void AnimationTrackEditor::_insert_key_from_track(float p_ofs, int p_track) {
StringName anim = "[stop]";
- undo_redo->create_action("Add Track Key");
+ undo_redo->create_action(TTR("Add Track Key"));
undo_redo->add_do_method(animation.ptr(), "track_insert_key", p_track, p_ofs, anim);
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", p_track, p_ofs);
undo_redo->commit_action();
@@ -3816,7 +3843,7 @@ void AnimationTrackEditor::_add_method_key(const String &p_method) {
}
d["args"] = params;
- undo_redo->create_action("Add Method Track Key");
+ undo_redo->create_action(TTR("Add Method Track Key"));
undo_redo->add_do_method(animation.ptr(), "track_insert_key", insert_key_from_track_call_track, insert_key_from_track_call_ofs, d);
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", insert_key_from_track_call_track, insert_key_from_track_call_ofs);
undo_redo->commit_action();
@@ -4318,9 +4345,9 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
text = node->get_name();
Vector<StringName> sn = path.get_subnames();
- for (int i = 0; i < sn.size(); i++) {
+ for (int j = 0; j < sn.size(); j++) {
text += ".";
- text += sn[i];
+ text += sn[j];
}
path = NodePath(node->get_path().get_names(), path.get_subnames(), true); //store full path instead for copying
@@ -4397,7 +4424,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
}
int base_track = animation->get_track_count();
- undo_redo->create_action("Paste Tracks");
+ undo_redo->create_action(TTR("Paste Tracks"));
for (int i = 0; i < track_clipboard.size(); i++) {
undo_redo->add_do_method(animation.ptr(), "add_track", track_clipboard[i].track_type);
Node *exists = NULL;
@@ -4726,10 +4753,12 @@ float AnimationTrackEditor::snap_time(float p_value) {
void AnimationTrackEditor::_bind_methods() {
ClassDB::bind_method("_animation_changed", &AnimationTrackEditor::_animation_changed);
+ ClassDB::bind_method("_animation_update", &AnimationTrackEditor::_animation_update);
ClassDB::bind_method("_timeline_changed", &AnimationTrackEditor::_timeline_changed);
ClassDB::bind_method("_track_remove_request", &AnimationTrackEditor::_track_remove_request);
ClassDB::bind_method("_name_limit_changed", &AnimationTrackEditor::_name_limit_changed);
ClassDB::bind_method("_update_scroll", &AnimationTrackEditor::_update_scroll);
+ ClassDB::bind_method("_update_tracks", &AnimationTrackEditor::_update_tracks);
ClassDB::bind_method("_update_step", &AnimationTrackEditor::_update_step);
ClassDB::bind_method("_update_length", &AnimationTrackEditor::_update_length);
ClassDB::bind_method("_dropped_track", &AnimationTrackEditor::_dropped_track);
@@ -4767,7 +4796,6 @@ void AnimationTrackEditor::_bind_methods() {
AnimationTrackEditor::AnimationTrackEditor() {
root = NULL;
- block_animation_update = false;
undo_redo = EditorNode::get_singleton()->get_undo_redo();
@@ -4785,7 +4813,6 @@ AnimationTrackEditor::AnimationTrackEditor() {
timeline_vbox->add_constant_override("separation", 0);
timeline = memnew(AnimationTimelineEdit);
- timeline->set_block_animation_update_ptr(&block_animation_update);
timeline->set_undo_redo(undo_redo);
timeline_vbox->add_child(timeline);
timeline->connect("timeline_changed", this, "_timeline_changed");
@@ -4804,7 +4831,6 @@ AnimationTrackEditor::AnimationTrackEditor() {
bezier_edit = memnew(AnimationBezierTrackEdit);
timeline_vbox->add_child(bezier_edit);
- bezier_edit->set_block_animation_update_ptr(&block_animation_update);
bezier_edit->set_undo_redo(undo_redo);
bezier_edit->set_editor(this);
bezier_edit->set_timeline(timeline);
@@ -5034,6 +5060,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
track_copy_select->set_hide_root(true);
track_copy_dialog->add_child(track_copy_select);
track_copy_dialog->connect("confirmed", this, "_edit_menu_pressed", varray(EDIT_COPY_TRACKS_CONFIRM));
+ animation_changing_awaiting_update = false;
}
AnimationTrackEditor::~AnimationTrackEditor() {