summaryrefslogtreecommitdiff
path: root/editor/animation_track_editor.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/animation_track_editor.h')
-rw-r--r--editor/animation_track_editor.h52
1 files changed, 27 insertions, 25 deletions
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h
index 92b203d183..18ce2ded63 100644
--- a/editor/animation_track_editor.h
+++ b/editor/animation_track_editor.h
@@ -54,10 +54,10 @@ class AnimationTimelineEdit : public Range {
Ref<Animation> animation;
AnimationTrackEdit *track_edit = nullptr;
- int name_limit;
+ int name_limit = 0;
Range *zoom = nullptr;
Range *h_scroll = nullptr;
- float play_position_pos;
+ float play_position_pos = 0.0f;
HBoxContainer *len_hb = nullptr;
EditorSpinSlider *length = nullptr;
@@ -86,8 +86,8 @@ class AnimationTimelineEdit : public Range {
bool dragging_timeline = false;
bool dragging_hsize = false;
- float dragging_hsize_from;
- float dragging_hsize_at;
+ float dragging_hsize_from = 0.0f;
+ float dragging_hsize_at = 0.0f;
virtual void gui_input(const Ref<InputEvent> &p_event) override;
void _track_added(int p_track);
@@ -145,17 +145,18 @@ class AnimationTrackEdit : public Control {
MENU_KEY_ADD_RESET,
MENU_KEY_DELETE
};
+
AnimationTimelineEdit *timeline = nullptr;
UndoRedo *undo_redo = nullptr;
Popup *path_popup = nullptr;
LineEdit *path = nullptr;
Node *root = nullptr;
Control *play_position = nullptr; //separate control used to draw so updates for only position changed are much faster
- float play_position_pos;
+ float play_position_pos = 0.0f;
NodePath node_path;
Ref<Animation> animation;
- int track;
+ int track = 0;
Rect2 check_rect;
Rect2 path_rect;
@@ -187,12 +188,12 @@ class AnimationTrackEdit : public Control {
Ref<Texture2D> _get_key_type_icon() const;
- mutable int dropping_at;
- float insert_at_pos;
+ mutable int dropping_at = 0;
+ float insert_at_pos = 0.0f;
bool moving_selection_attempt = false;
- int select_single_attempt;
+ int select_single_attempt = -1;
bool moving_selection = false;
- float moving_selection_from_ofs;
+ float moving_selection_from_ofs = 0.0f;
bool in_group = false;
AnimationTrackEditor *editor = nullptr;
@@ -341,7 +342,7 @@ class AnimationTrackEditor : public VBoxContainer {
PropertySelector *prop_selector = nullptr;
PropertySelector *method_selector = nullptr;
SceneTreeDialog *pick_track = nullptr;
- int adding_track_type;
+ int adding_track_type = 0;
NodePath adding_track_path;
bool keying = false;
@@ -353,7 +354,7 @@ class AnimationTrackEditor : public VBoxContainer {
Variant value;
String query;
bool advance = false;
- }; /* insert_data;*/
+ };
Label *insert_confirm_text = nullptr;
CheckBox *insert_confirm_bezier = nullptr;
@@ -374,10 +375,10 @@ class AnimationTrackEditor : public VBoxContainer {
reset = p_reset_anim ? p_reset_anim->get_track_count() : 0;
}
};
- TrackIndices _confirm_insert(InsertData p_id, TrackIndices p_next_tracks, bool p_create_reset, Ref<Animation> p_reset_anim, bool p_create_beziers);
- void _insert_track(bool p_create_reset, bool p_create_beziers);
+ TrackIndices _confirm_insert(InsertData p_id, TrackIndices p_next_tracks, bool p_reset_wanted, Ref<Animation> p_reset_anim, bool p_create_beziers);
+ void _insert_track(bool p_reset_wanted, bool p_create_beziers);
- void _root_removed(Node *p_root);
+ void _root_removed();
PropertyInfo _find_hint_for_track(int p_idx, NodePath &r_base_path, Variant *r_current_val = nullptr);
@@ -388,8 +389,8 @@ class AnimationTrackEditor : public VBoxContainer {
void _timeline_value_changed(double);
- float insert_key_from_track_call_ofs;
- int insert_key_from_track_call_track;
+ float insert_key_from_track_call_ofs = 0.0f;
+ int insert_key_from_track_call_track = 0;
void _insert_key_from_track(float p_ofs, int p_track);
void _add_method_key(const String &p_method);
@@ -409,13 +410,13 @@ class AnimationTrackEditor : public VBoxContainer {
float pos = 0;
};
- Map<SelectedKey, KeyInfo> selection;
+ RBMap<SelectedKey, KeyInfo> selection;
void _key_selected(int p_key, bool p_single, int p_track);
void _key_deselected(int p_key, int p_track);
bool moving_selection = false;
- float moving_selection_offset;
+ float moving_selection_offset = 0.0f;
void _move_selection_begin();
void _move_selection(float p_offset);
void _move_selection_commit();
@@ -459,7 +460,7 @@ class AnimationTrackEditor : public VBoxContainer {
void _edit_menu_about_to_popup();
void _edit_menu_pressed(int p_option);
- int last_menu_track_opt;
+ int last_menu_track_opt = 0;
void _cleanup_animation(Ref<Animation> p_animation);
@@ -477,10 +478,10 @@ class AnimationTrackEditor : public VBoxContainer {
struct TrackClipboard {
NodePath full_path;
NodePath base_path;
- Animation::TrackType track_type = Animation::TrackType::TYPE_ANIMATION;
- Animation::InterpolationType interp_type = Animation::InterpolationType::INTERPOLATION_CUBIC;
- Animation::UpdateMode update_mode = Animation::UpdateMode::UPDATE_CAPTURE;
- Animation::LoopMode loop_mode = Animation::LoopMode::LOOP_LINEAR;
+ Animation::TrackType track_type = Animation::TYPE_ANIMATION;
+ Animation::InterpolationType interp_type = Animation::INTERPOLATION_CUBIC;
+ Animation::UpdateMode update_mode = Animation::UPDATE_CAPTURE;
+ Animation::LoopMode loop_mode = Animation::LOOP_LINEAR;
bool loop_wrap = false;
bool enabled = false;
@@ -517,6 +518,7 @@ public:
EDIT_ADD_RESET_KEY,
EDIT_DELETE_SELECTION,
EDIT_GOTO_NEXT_STEP,
+ EDIT_GOTO_NEXT_STEP_TIMELINE_ONLY, // Next step without updating animation.
EDIT_GOTO_PREV_STEP,
EDIT_APPLY_RESET,
EDIT_OPTIMIZE_ANIMATION,
@@ -562,7 +564,7 @@ public:
void goto_prev_step(bool p_from_mouse_event);
/** If `p_from_mouse_event` is `true`, handle Shift key presses for precise snapping. */
- void goto_next_step(bool p_from_mouse_event);
+ void goto_next_step(bool p_from_mouse_event, bool p_timeline_only = false);
MenuButton *get_edit_menu();
AnimationTrackEditor();