Safer way to update animation if changed, fixes #26670

This commit is contained in:
Juan Linietsky
2019-03-06 10:22:38 -03:00
parent 4dd99701b0
commit 9b5c6f539b
3 changed files with 48 additions and 8 deletions

View File

@ -141,6 +141,7 @@ class AnimationTrackEdit : public Control {
Node *root;
Control *play_position; //separate control used to draw so updates for only position changed are much faster
float play_position_pos;
NodePath node_path;
Ref<Animation> animation;
int track;
@ -212,7 +213,7 @@ public:
AnimationTimelineEdit *get_timeline() const { return timeline; }
AnimationTrackEditor *get_editor() const { return editor; }
UndoRedo *get_undo_redo() const { return undo_redo; }
NodePath get_path() const;
void set_animation_and_track(const Ref<Animation> &p_animation, int p_track);
virtual Size2 get_minimum_size() const;
@ -306,6 +307,8 @@ class AnimationTrackEditor : public VBoxContainer {
Vector<AnimationTrackEdit *> track_edits;
Vector<AnimationTrackEditGroup *> groups;
bool animation_changing_awaiting_update;
void _animation_update();
int _get_track_selected();
void _animation_changed();
void _update_tracks();