diff options
Diffstat (limited to 'editor/animation_track_editor.h')
-rw-r--r-- | editor/animation_track_editor.h | 75 |
1 files changed, 47 insertions, 28 deletions
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 47058839ba..96fd10effd 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -31,6 +31,11 @@ #ifndef ANIMATION_TRACK_EDITOR_H #define ANIMATION_TRACK_EDITOR_H +#include "editor/editor_data.h" +#include "editor/editor_spin_slider.h" +#include "editor/property_editor.h" +#include "editor/property_selector.h" +#include "scene/animation/animation_cache.h" #include "scene/gui/control.h" #include "scene/gui/file_dialog.h" #include "scene/gui/menu_button.h" @@ -40,17 +45,11 @@ #include "scene/gui/tab_container.h" #include "scene/gui/texture_rect.h" #include "scene/gui/tool_button.h" - -#include "editor/property_selector.h" -#include "editor_data.h" -#include "editor_spin_slider.h" -#include "property_editor.h" -#include "scene/animation/animation_cache.h" #include "scene/resources/animation.h" #include "scene_tree_editor.h" class AnimationTimelineEdit : public Range { - GDCLASS(AnimationTimelineEdit, Range) + GDCLASS(AnimationTimelineEdit, Range); Ref<Animation> animation; int name_limit; @@ -76,7 +75,7 @@ class AnimationTimelineEdit : public Range { Rect2 hsize_rect; bool editing; - bool *block_animation_update_ptr; //used to block all tracks re-gen (speed up) + bool use_fps; bool panning_timeline; float panning_timeline_from; @@ -104,7 +103,6 @@ public: void set_zoom(Range *p_zoom); Range *get_zoom() const { return zoom; } void set_undo_redo(UndoRedo *p_undo_redo); - void set_block_animation_update_ptr(bool *p_block_ptr); void set_play_position(float p_pos); float get_play_position() const; @@ -112,6 +110,9 @@ public: void update_values(); + void set_use_fps(bool p_use_fps); + bool is_using_fps() const; + void set_hscroll(HScrollBar *p_hscroll); AnimationTimelineEdit(); @@ -121,7 +122,7 @@ class AnimationTrackEditor; class AnimationTrackEdit : public Control { - GDCLASS(AnimationTrackEdit, Control) + GDCLASS(AnimationTrackEdit, Control); enum { MENU_CALL_MODE_CONTINUOUS, @@ -143,6 +144,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; @@ -170,12 +172,11 @@ class AnimationTrackEdit : public Control { void _menu_selected(int p_index); - bool *block_animation_update_ptr; //used to block all tracks re-gen (speed up) - void _path_entered(const String &p_text); void _play_position_draw(); - mutable int dropping_at; + bool _is_value_key_valid(const Variant &p_key_value, Variant::Type &r_valid_type) const; + mutable int dropping_at; float insert_at_pos; bool moving_selection_attempt; int select_single_attempt; @@ -216,8 +217,7 @@ public: AnimationTimelineEdit *get_timeline() const { return timeline; } AnimationTrackEditor *get_editor() const { return editor; } UndoRedo *get_undo_redo() const { return undo_redo; } - bool *get_block_animation_update_ptr() { return block_animation_update_ptr; } - + NodePath get_path() const; void set_animation_and_track(const Ref<Animation> &p_animation, int p_track); virtual Size2 get_minimum_size() const; @@ -226,20 +226,19 @@ public: void set_editor(AnimationTrackEditor *p_editor); void set_root(Node *p_root); - void set_block_animation_update_ptr(bool *p_block_ptr); - void set_play_position(float p_pos); void update_play_position(); void cancel_drop(); void set_in_group(bool p_enable); - void append_to_selection(const Rect2 &p_box); + void append_to_selection(const Rect2 &p_box, bool p_deselection); AnimationTrackEdit(); }; class AnimationTrackEditPlugin : public Reference { - GDCLASS(AnimationTrackEditPlugin, Reference) + GDCLASS(AnimationTrackEditPlugin, Reference); + public: virtual AnimationTrackEdit *create_value_track_edit(Object *p_object, Variant::Type p_type, const String &p_property, PropertyHint p_hint, const String &p_hint_string, int p_usage); virtual AnimationTrackEdit *create_audio_track_edit(); @@ -247,10 +246,11 @@ public: }; class AnimationTrackKeyEdit; +class AnimationMultiTrackKeyEdit; class AnimationBezierTrackEdit; class AnimationTrackEditGroup : public Control { - GDCLASS(AnimationTrackEditGroup, Control) + GDCLASS(AnimationTrackEditGroup, Control); Ref<Texture> icon; String node_name; NodePath node; @@ -273,7 +273,7 @@ public: }; class AnimationTrackEditor : public VBoxContainer { - GDCLASS(AnimationTrackEditor, VBoxContainer) + GDCLASS(AnimationTrackEditor, VBoxContainer); enum { EDIT_COPY_TRACKS, @@ -309,12 +309,17 @@ class AnimationTrackEditor : public VBoxContainer { EditorSpinSlider *step; TextureRect *zoom_icon; ToolButton *snap; + OptionButton *snap_mode; + Button *imported_anim_warning; + void _show_imported_anim_warning() const; + + void _snap_mode_changed(int p_mode); Vector<AnimationTrackEdit *> track_edits; Vector<AnimationTrackEditGroup *> groups; - bool block_animation_update; - + bool animation_changing_awaiting_update; + void _animation_update(); int _get_track_selected(); void _animation_changed(); void _update_tracks(); @@ -322,18 +327,21 @@ class AnimationTrackEditor : public VBoxContainer { void _name_limit_changed(); void _timeline_changed(float p_new_pos, bool p_drag); void _track_remove_request(int p_track); + void _track_grab_focus(int p_track); UndoRedo *undo_redo; void _update_scroll(double); void _update_step(double p_new_step); - void _update_length(double p_new_step); + void _update_length(double p_new_len); void _dropped_track(int p_from_track, int p_to_track); void _add_track(int p_type); void _new_track_node_selected(NodePath p_path); void _new_track_property_selected(String p_name); + void _update_step_spinbox(); + PropertySelector *prop_selector; PropertySelector *method_selector; SceneTreeDialog *pick_track; @@ -408,6 +416,7 @@ class AnimationTrackEditor : public VBoxContainer { void _move_selection_cancel(); AnimationTrackKeyEdit *key_edit; + AnimationMultiTrackKeyEdit *multi_key_edit; void _update_key_edit(); void _clear_key_edit(); @@ -432,13 +441,15 @@ class AnimationTrackEditor : public VBoxContainer { SpinBox *optimize_max_angle; ConfirmationDialog *cleanup_dialog; - CheckButton *cleanup_keys; - CheckButton *cleanup_tracks; - CheckButton *cleanup_all; + CheckBox *cleanup_keys; + CheckBox *cleanup_tracks; + CheckBox *cleanup_all; ConfirmationDialog *scale_dialog; SpinBox *scale; + void _select_all_tracks_for_copy(); + void _edit_menu_pressed(int p_option); int last_menu_track_opt; @@ -452,8 +463,12 @@ class AnimationTrackEditor : public VBoxContainer { void _selection_changed(); + bool selected_all_tracks; ConfirmationDialog *track_copy_dialog; Tree *track_copy_select; + HBoxContainer *track_copy_options; + Button *select_all_button; + struct TrackClipboard { NodePath full_path; NodePath base_path; @@ -490,6 +505,9 @@ public: void update_keying(); bool has_keying() const; + Dictionary get_state() const; + void set_state(const Dictionary &p_state); + void cleanup(); void set_anim_pos(float p_pos); @@ -502,9 +520,10 @@ public: bool is_key_selected(int p_track, int p_key) const; bool is_selection_active() const; bool is_moving_selection() const; + bool is_snap_enabled() const; float get_moving_selection_offset() const; - bool is_snap_enabled(); float snap_time(float p_value); + bool is_grouping_tracks(); MenuButton *get_edit_menu(); AnimationTrackEditor(); |