animation_track_editor.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. /*************************************************************************/
  2. /* animation_track_editor.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifndef ANIMATION_TRACK_EDITOR_H
  31. #define ANIMATION_TRACK_EDITOR_H
  32. #include "editor/editor_data.h"
  33. #include "editor/editor_properties.h"
  34. #include "editor/editor_spin_slider.h"
  35. #include "editor/property_selector.h"
  36. #include "scene/3d/node_3d.h"
  37. #include "scene/gui/check_box.h"
  38. #include "scene/gui/control.h"
  39. #include "scene/gui/menu_button.h"
  40. #include "scene/gui/option_button.h"
  41. #include "scene/gui/panel_container.h"
  42. #include "scene/gui/scroll_bar.h"
  43. #include "scene/gui/slider.h"
  44. #include "scene/gui/spin_box.h"
  45. #include "scene/gui/tab_container.h"
  46. #include "scene/gui/texture_rect.h"
  47. #include "scene/resources/animation.h"
  48. #include "scene_tree_editor.h"
  49. class AnimationTrackEdit;
  50. class ViewPanner;
  51. class AnimationTimelineEdit : public Range {
  52. GDCLASS(AnimationTimelineEdit, Range);
  53. Ref<Animation> animation;
  54. bool read_only = false;
  55. AnimationTrackEdit *track_edit = nullptr;
  56. int name_limit = 0;
  57. Range *zoom = nullptr;
  58. Range *h_scroll = nullptr;
  59. float play_position_pos = 0.0f;
  60. HBoxContainer *len_hb = nullptr;
  61. EditorSpinSlider *length = nullptr;
  62. Button *loop = nullptr;
  63. TextureRect *time_icon = nullptr;
  64. MenuButton *add_track = nullptr;
  65. Control *play_position = nullptr; //separate control used to draw so updates for only position changed are much faster
  66. HScrollBar *hscroll = nullptr;
  67. void _zoom_changed(double);
  68. void _anim_length_changed(double p_new_len);
  69. void _anim_loop_pressed();
  70. void _play_position_draw();
  71. Ref<EditorUndoRedoManager> undo_redo;
  72. Rect2 hsize_rect;
  73. bool editing = false;
  74. bool use_fps = false;
  75. Ref<ViewPanner> panner;
  76. void _scroll_callback(Vector2 p_scroll_vec, bool p_alt);
  77. void _pan_callback(Vector2 p_scroll_vec);
  78. void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt);
  79. bool dragging_timeline = false;
  80. bool dragging_hsize = false;
  81. float dragging_hsize_from = 0.0f;
  82. float dragging_hsize_at = 0.0f;
  83. virtual void gui_input(const Ref<InputEvent> &p_event) override;
  84. void _track_added(int p_track);
  85. protected:
  86. static void _bind_methods();
  87. void _notification(int p_what);
  88. public:
  89. int get_name_limit() const;
  90. int get_buttons_width() const;
  91. float get_zoom_scale() const;
  92. virtual Size2 get_minimum_size() const override;
  93. void set_animation(const Ref<Animation> &p_animation, bool p_read_only);
  94. void set_track_edit(AnimationTrackEdit *p_track_edit);
  95. void set_zoom(Range *p_zoom);
  96. Range *get_zoom() const { return zoom; }
  97. void set_undo_redo(Ref<EditorUndoRedoManager> p_undo_redo);
  98. void set_play_position(float p_pos);
  99. float get_play_position() const;
  100. void update_play_position();
  101. void update_values();
  102. void set_use_fps(bool p_use_fps);
  103. bool is_using_fps() const;
  104. void set_hscroll(HScrollBar *p_hscroll);
  105. virtual CursorShape get_cursor_shape(const Point2 &p_pos) const override;
  106. AnimationTimelineEdit();
  107. };
  108. class AnimationTrackEditor;
  109. class AnimationTrackEdit : public Control {
  110. GDCLASS(AnimationTrackEdit, Control);
  111. enum {
  112. MENU_CALL_MODE_CONTINUOUS,
  113. MENU_CALL_MODE_DISCRETE,
  114. MENU_CALL_MODE_TRIGGER,
  115. MENU_CALL_MODE_CAPTURE,
  116. MENU_INTERPOLATION_NEAREST,
  117. MENU_INTERPOLATION_LINEAR,
  118. MENU_INTERPOLATION_CUBIC,
  119. MENU_INTERPOLATION_LINEAR_ANGLE,
  120. MENU_INTERPOLATION_CUBIC_ANGLE,
  121. MENU_LOOP_WRAP,
  122. MENU_LOOP_CLAMP,
  123. MENU_KEY_INSERT,
  124. MENU_KEY_DUPLICATE,
  125. MENU_KEY_ADD_RESET,
  126. MENU_KEY_DELETE
  127. };
  128. AnimationTimelineEdit *timeline = nullptr;
  129. Ref<EditorUndoRedoManager> undo_redo;
  130. Popup *path_popup = nullptr;
  131. LineEdit *path = nullptr;
  132. Node *root = nullptr;
  133. Control *play_position = nullptr; //separate control used to draw so updates for only position changed are much faster
  134. float play_position_pos = 0.0f;
  135. NodePath node_path;
  136. Ref<Animation> animation;
  137. bool read_only = false;
  138. int track = 0;
  139. Rect2 check_rect;
  140. Rect2 path_rect;
  141. Rect2 update_mode_rect;
  142. Rect2 interp_mode_rect;
  143. Rect2 loop_wrap_rect;
  144. Rect2 remove_rect;
  145. Ref<Texture2D> type_icon;
  146. Ref<Texture2D> selected_icon;
  147. PopupMenu *menu = nullptr;
  148. bool hovered = false;
  149. bool clicking_on_name = false;
  150. int hovering_key_idx = -1;
  151. void _zoom_changed();
  152. Ref<Texture2D> icon_cache;
  153. String path_cache;
  154. void _menu_selected(int p_index);
  155. void _path_submitted(const String &p_text);
  156. void _play_position_draw();
  157. bool _is_value_key_valid(const Variant &p_key_value, Variant::Type &r_valid_type) const;
  158. Ref<Texture2D> _get_key_type_icon() const;
  159. mutable int dropping_at = 0;
  160. float insert_at_pos = 0.0f;
  161. bool moving_selection_attempt = false;
  162. int select_single_attempt = -1;
  163. bool moving_selection = false;
  164. float moving_selection_from_ofs = 0.0f;
  165. bool in_group = false;
  166. AnimationTrackEditor *editor = nullptr;
  167. protected:
  168. static void _bind_methods();
  169. void _notification(int p_what);
  170. virtual void gui_input(const Ref<InputEvent> &p_event) override;
  171. public:
  172. virtual Variant get_drag_data(const Point2 &p_point) override;
  173. virtual bool can_drop_data(const Point2 &p_point, const Variant &p_data) const override;
  174. virtual void drop_data(const Point2 &p_point, const Variant &p_data) override;
  175. virtual String get_tooltip(const Point2 &p_pos) const override;
  176. virtual int get_key_height() const;
  177. virtual Rect2 get_key_rect(int p_index, float p_pixels_sec);
  178. virtual bool is_key_selectable_by_distance() const;
  179. virtual void draw_key_link(int p_index, float p_pixels_sec, int p_x, int p_next_x, int p_clip_left, int p_clip_right);
  180. virtual void draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right);
  181. virtual void draw_bg(int p_clip_left, int p_clip_right);
  182. virtual void draw_fg(int p_clip_left, int p_clip_right);
  183. //helper
  184. void draw_texture_region_clipped(const Ref<Texture2D> &p_texture, const Rect2 &p_rect, const Rect2 &p_region);
  185. void draw_rect_clipped(const Rect2 &p_rect, const Color &p_color, bool p_filled = true);
  186. int get_track() const;
  187. Ref<Animation> get_animation() const;
  188. AnimationTimelineEdit *get_timeline() const { return timeline; }
  189. AnimationTrackEditor *get_editor() const { return editor; }
  190. Ref<EditorUndoRedoManager> get_undo_redo() const;
  191. NodePath get_path() const;
  192. void set_animation_and_track(const Ref<Animation> &p_animation, int p_track, bool p_read_only);
  193. virtual Size2 get_minimum_size() const override;
  194. void set_undo_redo(Ref<EditorUndoRedoManager> p_undo_redo);
  195. void set_timeline(AnimationTimelineEdit *p_timeline);
  196. void set_editor(AnimationTrackEditor *p_editor);
  197. void set_root(Node *p_root);
  198. void set_play_position(float p_pos);
  199. void update_play_position();
  200. void cancel_drop();
  201. void set_in_group(bool p_enable);
  202. void append_to_selection(const Rect2 &p_box, bool p_deselection);
  203. AnimationTrackEdit();
  204. };
  205. class AnimationTrackEditPlugin : public RefCounted {
  206. GDCLASS(AnimationTrackEditPlugin, RefCounted);
  207. public:
  208. 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);
  209. virtual AnimationTrackEdit *create_audio_track_edit();
  210. virtual AnimationTrackEdit *create_animation_track_edit(Object *p_object);
  211. };
  212. class AnimationTrackKeyEdit;
  213. class AnimationMultiTrackKeyEdit;
  214. class AnimationBezierTrackEdit;
  215. class AnimationTrackEditGroup : public Control {
  216. GDCLASS(AnimationTrackEditGroup, Control);
  217. Ref<Texture2D> icon;
  218. String node_name;
  219. NodePath node;
  220. Node *root = nullptr;
  221. AnimationTimelineEdit *timeline = nullptr;
  222. void _zoom_changed();
  223. protected:
  224. static void _bind_methods();
  225. void _notification(int p_what);
  226. public:
  227. void set_type_and_name(const Ref<Texture2D> &p_type, const String &p_name, const NodePath &p_node);
  228. virtual Size2 get_minimum_size() const override;
  229. void set_timeline(AnimationTimelineEdit *p_timeline);
  230. void set_root(Node *p_root);
  231. AnimationTrackEditGroup();
  232. };
  233. class AnimationTrackEditor : public VBoxContainer {
  234. GDCLASS(AnimationTrackEditor, VBoxContainer);
  235. Ref<Animation> animation;
  236. bool read_only = false;
  237. Node *root = nullptr;
  238. MenuButton *edit = nullptr;
  239. PanelContainer *main_panel = nullptr;
  240. HScrollBar *hscroll = nullptr;
  241. ScrollContainer *scroll = nullptr;
  242. VBoxContainer *track_vbox = nullptr;
  243. AnimationBezierTrackEdit *bezier_edit = nullptr;
  244. Label *info_message = nullptr;
  245. AnimationTimelineEdit *timeline = nullptr;
  246. HSlider *zoom = nullptr;
  247. EditorSpinSlider *step = nullptr;
  248. TextureRect *zoom_icon = nullptr;
  249. Button *snap = nullptr;
  250. Button *bezier_edit_icon = nullptr;
  251. OptionButton *snap_mode = nullptr;
  252. Button *imported_anim_warning = nullptr;
  253. void _show_imported_anim_warning();
  254. void _snap_mode_changed(int p_mode);
  255. Vector<AnimationTrackEdit *> track_edits;
  256. Vector<AnimationTrackEditGroup *> groups;
  257. bool animation_changing_awaiting_update = false;
  258. void _animation_update(); // Updated by AnimationTrackEditor(this)
  259. int _get_track_selected();
  260. void _sync_animation_change();
  261. void _animation_changed();
  262. void _update_tracks();
  263. void _redraw_tracks();
  264. void _redraw_groups();
  265. void _name_limit_changed();
  266. void _timeline_changed(float p_new_pos, bool p_drag, bool p_timeline_only);
  267. void _track_remove_request(int p_track);
  268. void _animation_track_remove_request(int p_track, Ref<Animation> p_from_animation);
  269. void _track_grab_focus(int p_track);
  270. Ref<EditorUndoRedoManager> undo_redo;
  271. void _update_scroll(double);
  272. void _update_step(double p_new_step);
  273. void _update_length(double p_new_len);
  274. void _dropped_track(int p_from_track, int p_to_track);
  275. void _add_track(int p_type);
  276. void _new_track_node_selected(NodePath p_path);
  277. void _new_track_property_selected(String p_name);
  278. void _update_step_spinbox();
  279. PropertySelector *prop_selector = nullptr;
  280. PropertySelector *method_selector = nullptr;
  281. SceneTreeDialog *pick_track = nullptr;
  282. int adding_track_type = 0;
  283. NodePath adding_track_path;
  284. bool keying = false;
  285. struct InsertData {
  286. Animation::TrackType type;
  287. NodePath path;
  288. int track_idx = 0;
  289. Variant value;
  290. String query;
  291. bool advance = false;
  292. };
  293. Label *insert_confirm_text = nullptr;
  294. CheckBox *insert_confirm_bezier = nullptr;
  295. CheckBox *insert_confirm_reset = nullptr;
  296. ConfirmationDialog *insert_confirm = nullptr;
  297. bool insert_queue = false;
  298. List<InsertData> insert_data;
  299. void _query_insert(const InsertData &p_id);
  300. Ref<Animation> _create_and_get_reset_animation();
  301. void _confirm_insert_list();
  302. struct TrackIndices {
  303. int normal;
  304. int reset;
  305. TrackIndices(const Animation *p_anim = nullptr, const Animation *p_reset_anim = nullptr) {
  306. normal = p_anim ? p_anim->get_track_count() : 0;
  307. reset = p_reset_anim ? p_reset_anim->get_track_count() : 0;
  308. }
  309. };
  310. TrackIndices _confirm_insert(InsertData p_id, TrackIndices p_next_tracks, bool p_reset_wanted, Ref<Animation> p_reset_anim, bool p_create_beziers);
  311. void _insert_track(bool p_reset_wanted, bool p_create_beziers);
  312. void _root_removed();
  313. PropertyInfo _find_hint_for_track(int p_idx, NodePath &r_base_path, Variant *r_current_val = nullptr);
  314. Ref<ViewPanner> panner;
  315. void _scroll_callback(Vector2 p_scroll_vec, bool p_alt);
  316. void _pan_callback(Vector2 p_scroll_vec);
  317. void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt);
  318. void _timeline_value_changed(double);
  319. float insert_key_from_track_call_ofs = 0.0f;
  320. int insert_key_from_track_call_track = 0;
  321. void _insert_key_from_track(float p_ofs, int p_track);
  322. void _add_method_key(const String &p_method);
  323. void _clear_selection(bool p_update = false);
  324. void _clear_selection_for_anim(const Ref<Animation> &p_anim);
  325. void _select_at_anim(const Ref<Animation> &p_anim, int p_track, float p_pos);
  326. //selection
  327. struct SelectedKey {
  328. int track = 0;
  329. int key = 0;
  330. bool operator<(const SelectedKey &p_key) const { return track == p_key.track ? key < p_key.key : track < p_key.track; };
  331. };
  332. struct KeyInfo {
  333. float pos = 0;
  334. };
  335. RBMap<SelectedKey, KeyInfo> selection;
  336. void _key_selected(int p_key, bool p_single, int p_track);
  337. void _key_deselected(int p_key, int p_track);
  338. bool moving_selection = false;
  339. float moving_selection_offset = 0.0f;
  340. void _move_selection_begin();
  341. void _move_selection(float p_offset);
  342. void _move_selection_commit();
  343. void _move_selection_cancel();
  344. AnimationTrackKeyEdit *key_edit = nullptr;
  345. AnimationMultiTrackKeyEdit *multi_key_edit = nullptr;
  346. void _update_key_edit();
  347. void _clear_key_edit();
  348. Control *box_selection = nullptr;
  349. void _box_selection_draw();
  350. bool box_selecting = false;
  351. Vector2 box_selecting_from;
  352. Rect2 box_select_rect;
  353. void _scroll_input(const Ref<InputEvent> &p_event);
  354. Vector<Ref<AnimationTrackEditPlugin>> track_edit_plugins;
  355. void _toggle_bezier_edit();
  356. void _cancel_bezier_edit();
  357. void _bezier_edit(int p_for_track);
  358. void _bezier_track_set_key_handle_mode(Animation *p_anim, int p_track, int p_index, Animation::HandleMode p_mode, Animation::HandleSetMode p_set_mode = Animation::HANDLE_SET_MODE_NONE);
  359. ////////////// edit menu stuff
  360. ConfirmationDialog *bake_dialog = nullptr;
  361. CheckBox *bake_trs = nullptr;
  362. CheckBox *bake_blendshape = nullptr;
  363. CheckBox *bake_value = nullptr;
  364. SpinBox *bake_fps = nullptr;
  365. ConfirmationDialog *optimize_dialog = nullptr;
  366. SpinBox *optimize_velocity_error = nullptr;
  367. SpinBox *optimize_angular_error = nullptr;
  368. SpinBox *optimize_precision_error = nullptr;
  369. ConfirmationDialog *cleanup_dialog = nullptr;
  370. CheckBox *cleanup_keys = nullptr;
  371. CheckBox *cleanup_tracks = nullptr;
  372. CheckBox *cleanup_all = nullptr;
  373. ConfirmationDialog *scale_dialog = nullptr;
  374. SpinBox *scale = nullptr;
  375. ConfirmationDialog *ease_dialog = nullptr;
  376. OptionButton *transition_selection = nullptr;
  377. OptionButton *ease_selection = nullptr;
  378. SpinBox *ease_fps = nullptr;
  379. void _select_all_tracks_for_copy();
  380. void _edit_menu_about_to_popup();
  381. void _edit_menu_pressed(int p_option);
  382. int last_menu_track_opt = 0;
  383. void _cleanup_animation(Ref<Animation> p_animation);
  384. void _anim_duplicate_keys(bool transpose);
  385. void _view_group_toggle();
  386. Button *view_group = nullptr;
  387. Button *selected_filter = nullptr;
  388. void _selection_changed();
  389. ConfirmationDialog *track_copy_dialog = nullptr;
  390. Tree *track_copy_select = nullptr;
  391. struct TrackClipboard {
  392. NodePath full_path;
  393. NodePath base_path;
  394. Animation::TrackType track_type = Animation::TYPE_ANIMATION;
  395. Animation::InterpolationType interp_type = Animation::INTERPOLATION_CUBIC_ANGLE;
  396. Animation::UpdateMode update_mode = Animation::UPDATE_CAPTURE;
  397. Animation::LoopMode loop_mode = Animation::LOOP_PINGPONG;
  398. bool loop_wrap = false;
  399. bool enabled = false;
  400. struct Key {
  401. float time = 0;
  402. float transition = 0;
  403. Variant value;
  404. };
  405. Vector<Key> keys;
  406. };
  407. Vector<TrackClipboard> track_clipboard;
  408. void _insert_animation_key(NodePath p_path, const Variant &p_value);
  409. void _pick_track_filter_text_changed(const String &p_newtext);
  410. void _pick_track_select_recursive(TreeItem *p_item, const String &p_filter, Vector<Node *> &p_select_candidates);
  411. void _pick_track_filter_input(const Ref<InputEvent> &p_ie);
  412. protected:
  413. static void _bind_methods();
  414. void _notification(int p_what);
  415. public:
  416. enum {
  417. EDIT_COPY_TRACKS,
  418. EDIT_COPY_TRACKS_CONFIRM,
  419. EDIT_PASTE_TRACKS,
  420. EDIT_SCALE_SELECTION,
  421. EDIT_SCALE_FROM_CURSOR,
  422. EDIT_SCALE_CONFIRM,
  423. EDIT_EASE_SELECTION,
  424. EDIT_EASE_CONFIRM,
  425. EDIT_DUPLICATE_SELECTION,
  426. EDIT_DUPLICATE_TRANSPOSED,
  427. EDIT_ADD_RESET_KEY,
  428. EDIT_DELETE_SELECTION,
  429. EDIT_GOTO_NEXT_STEP,
  430. EDIT_GOTO_NEXT_STEP_TIMELINE_ONLY, // Next step without updating animation.
  431. EDIT_GOTO_PREV_STEP,
  432. EDIT_APPLY_RESET,
  433. EDIT_BAKE_ANIMATION,
  434. EDIT_BAKE_ANIMATION_CONFIRM,
  435. EDIT_OPTIMIZE_ANIMATION,
  436. EDIT_OPTIMIZE_ANIMATION_CONFIRM,
  437. EDIT_CLEAN_UP_ANIMATION,
  438. EDIT_CLEAN_UP_ANIMATION_CONFIRM
  439. };
  440. void add_track_edit_plugin(const Ref<AnimationTrackEditPlugin> &p_plugin);
  441. void remove_track_edit_plugin(const Ref<AnimationTrackEditPlugin> &p_plugin);
  442. void set_animation(const Ref<Animation> &p_anim, bool p_read_only);
  443. Ref<Animation> get_current_animation() const;
  444. void set_root(Node *p_root);
  445. Node *get_root() const;
  446. void update_keying();
  447. bool has_keying() const;
  448. Dictionary get_state() const;
  449. void set_state(const Dictionary &p_state);
  450. void cleanup();
  451. void set_anim_pos(float p_pos);
  452. void insert_node_value_key(Node *p_node, const String &p_property, const Variant &p_value, bool p_only_if_exists = false);
  453. void insert_value_key(const String &p_property, const Variant &p_value, bool p_advance);
  454. void insert_transform_key(Node3D *p_node, const String &p_sub, const Animation::TrackType p_type, const Variant p_value);
  455. bool has_track(Node3D *p_node, const String &p_sub, const Animation::TrackType p_type);
  456. void make_insert_queue();
  457. void commit_insert_queue();
  458. void show_select_node_warning(bool p_show);
  459. bool is_key_selected(int p_track, int p_key) const;
  460. bool is_selection_active() const;
  461. bool is_moving_selection() const;
  462. bool is_snap_enabled() const;
  463. float get_moving_selection_offset() const;
  464. float snap_time(float p_value, bool p_relative = false);
  465. bool is_grouping_tracks();
  466. /** If `p_from_mouse_event` is `true`, handle Shift key presses for precise snapping. */
  467. void goto_prev_step(bool p_from_mouse_event);
  468. /** If `p_from_mouse_event` is `true`, handle Shift key presses for precise snapping. */
  469. void goto_next_step(bool p_from_mouse_event, bool p_timeline_only = false);
  470. MenuButton *get_edit_menu();
  471. AnimationTrackEditor();
  472. ~AnimationTrackEditor();
  473. };
  474. #endif // ANIMATION_TRACK_EDITOR_H