3434#include " core/input/input.h"
3535#include " core/os/keyboard.h"
3636#include " editor/animation/animation_tree_editor_plugin.h"
37+ #include " editor/docks/editor_dock_manager.h"
3738#include " editor/docks/inspector_dock.h"
3839#include " editor/docks/scene_tree_dock.h"
3940#include " editor/editor_node.h"
4041#include " editor/editor_undo_redo_manager.h"
41- #include " editor/gui/editor_bottom_panel.h"
4242#include " editor/gui/editor_file_dialog.h"
4343#include " editor/gui/editor_validation_panel.h"
4444#include " editor/scene/3d/node_3d_editor_plugin.h" // For onion skinning.
@@ -140,14 +140,14 @@ void AnimationPlayerEditor::_notification(int p_what) {
140140 } break ;
141141
142142 case NOTIFICATION_ENTER_TREE : {
143- tool_anim->get_popup ()->connect (SceneStringName (id_pressed), callable_mp (this , &AnimationPlayerEditor::_animation_tool_menu));
144-
145- onion_skinning->get_popup ()->connect (SceneStringName (id_pressed), callable_mp (this , &AnimationPlayerEditor::_onion_skinning_menu));
146-
147- blend_editor.next ->connect (SceneStringName (item_selected), callable_mp (this , &AnimationPlayerEditor::_blend_editor_next_changed));
148-
149143 get_tree ()->connect (SNAME (" node_removed" ), callable_mp (this , &AnimationPlayerEditor::_node_removed));
144+ } break ;
150145
146+ case NOTIFICATION_EXIT_TREE : {
147+ get_tree ()->disconnect (SNAME (" node_removed" ), callable_mp (this , &AnimationPlayerEditor::_node_removed));
148+ } break ;
149+
150+ case NOTIFICATION_READY : {
151151 EditorNode::get_singleton ()->connect (" scene_changed" , callable_mp (this , &AnimationPlayerEditor::_find_player));
152152
153153 add_theme_style_override (SceneStringName (panel), EditorNode::get_singleton ()->get_editor_theme ()->get_stylebox (SceneStringName (panel), SNAME (" Panel" )));
@@ -929,7 +929,7 @@ void AnimationPlayerEditor::set_state(const Dictionary &p_state) {
929929 }
930930
931931 _update_player ();
932- EditorNode::get_bottom_panel ()-> make_item_visible ( this );
932+ make_visible ( );
933933 set_process (true );
934934 ensure_visibility ();
935935
@@ -2042,11 +2042,19 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug
20422042 plugin = p_plugin;
20432043 singleton = this ;
20442044
2045+ set_name (TTRC (" Animation" ));
2046+ set_icon_name (" Animation" );
2047+ set_dock_shortcut (ED_SHORTCUT_AND_COMMAND (" bottom_panels/toggle_animation_bottom_panel" , TTRC (" Toggle Animation Dock" ), KeyModifierMask::ALT | Key::N));
2048+ set_default_slot (DockConstants::DOCK_SLOT_BOTTOM );
2049+ set_available_layouts (EditorDock::DOCK_LAYOUT_HORIZONTAL | EditorDock::DOCK_LAYOUT_FLOATING );
2050+
20452051 set_focus_mode (FOCUS_ALL );
20462052 set_process_shortcut_input (true );
20472053
2054+ VBoxContainer *main_vbox_container = memnew (VBoxContainer);
2055+ add_child (main_vbox_container);
20482056 HBoxContainer *hb = memnew (HBoxContainer);
2049- add_child (hb);
2057+ main_vbox_container-> add_child (hb);
20502058
20512059 HBoxContainer *playback_container = memnew (HBoxContainer);
20522060 playback_container->set_layout_direction (LAYOUT_DIRECTION_LTR );
@@ -2114,6 +2122,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug
21142122 tool_anim->get_popup ()->add_separator ();
21152123 tool_anim->get_popup ()->add_shortcut (ED_SHORTCUT (" animation_player_editor/remove_animation" , TTRC (" Remove" )), TOOL_REMOVE_ANIM );
21162124 tool_anim->set_disabled (true );
2125+ tool_anim->get_popup ()->connect (SceneStringName (id_pressed), callable_mp (this , &AnimationPlayerEditor::_animation_tool_menu));
21172126 hb->add_child (tool_anim);
21182127
21192128 animation = memnew (OptionButton);
@@ -2163,6 +2172,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug
21632172 onion_skinning->get_popup ()->add_check_item (TTR (" Differences Only" ), ONION_SKINNING_DIFFERENCES_ONLY );
21642173 onion_skinning->get_popup ()->add_check_item (TTR (" Force White Modulate" ), ONION_SKINNING_FORCE_WHITE_MODULATE );
21652174 onion_skinning->get_popup ()->add_check_item (TTR (" Include Gizmos (3D)" ), ONION_SKINNING_INCLUDE_GIZMOS );
2175+ onion_skinning->get_popup ()->connect (SceneStringName (id_pressed), callable_mp (this , &AnimationPlayerEditor::_onion_skinning_menu));
21662176 hb->add_child (onion_skinning);
21672177
21682178 hb->add_child (memnew (VSeparator));
@@ -2226,6 +2236,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug
22262236
22272237 blend_editor.next = memnew (OptionButton);
22282238 blend_editor.next ->set_auto_translate_mode (AUTO_TRANSLATE_MODE_DISABLED );
2239+ blend_editor.next ->connect (SceneStringName (item_selected), callable_mp (this , &AnimationPlayerEditor::_blend_editor_next_changed));
22292240 blend_vb->add_margin_child (TTR (" Next (Auto Queue):" ), blend_editor.next );
22302241
22312242 autoplay->connect (SceneStringName (pressed), callable_mp (this , &AnimationPlayerEditor::_autoplay_pressed));
@@ -2241,7 +2252,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug
22412252 frame->connect (SceneStringName (value_changed), callable_mp (this , &AnimationPlayerEditor::_seek_value_changed).bind (false ));
22422253 scale->connect (SceneStringName (text_submitted), callable_mp (this , &AnimationPlayerEditor::_scale_changed));
22432254
2244- add_child (track_editor);
2255+ main_vbox_container-> add_child (track_editor);
22452256 track_editor->set_v_size_flags (SIZE_EXPAND_FILL );
22462257 track_editor->connect (SNAME (" timeline_changed" ), callable_mp (this , &AnimationPlayerEditor::_animation_key_editor_seek));
22472258 track_editor->connect (SNAME (" animation_len_changed" ), callable_mp (this , &AnimationPlayerEditor::_animation_key_editor_anim_len_changed));
@@ -2309,7 +2320,7 @@ AnimationPlayerEditor::~AnimationPlayerEditor() {
23092320
23102321void AnimationPlayerEditorPlugin::_notification (int p_what) {
23112322 switch (p_what) {
2312- case NOTIFICATION_ENTER_TREE : {
2323+ case NOTIFICATION_READY : {
23132324 Node3DEditor::get_singleton ()->connect (SNAME (" transform_key_request" ), callable_mp (this , &AnimationPlayerEditorPlugin::_transform_key_request));
23142325 InspectorDock::get_inspector_singleton ()->connect (SNAME (" property_keyed" ), callable_mp (this , &AnimationPlayerEditorPlugin::_property_keyed));
23152326 anim_editor->get_track_editor ()->connect (SNAME (" keying_changed" ), callable_mp (this , &AnimationPlayerEditorPlugin::_update_keying));
@@ -2437,15 +2448,15 @@ void AnimationPlayerEditorPlugin::make_visible(bool p_visible) {
24372448 if (AnimationTreeEditor::get_singleton () && AnimationTreeEditor::get_singleton ()->is_visible_in_tree ()) {
24382449 return ;
24392450 }
2440- EditorNode::get_bottom_panel ()-> make_item_visible (anim_editor );
2451+ anim_editor-> make_visible ( );
24412452 anim_editor->set_process (true );
24422453 anim_editor->ensure_visibility ();
24432454 }
24442455}
24452456
24462457AnimationPlayerEditorPlugin::AnimationPlayerEditorPlugin () {
24472458 anim_editor = memnew (AnimationPlayerEditor (this ));
2448- EditorNode::get_bottom_panel ()->add_item ( TTRC ( " Animation " ), anim_editor, ED_SHORTCUT_AND_COMMAND ( " bottom_panels/toggle_animation_bottom_panel " , TTRC ( " Toggle Animation Bottom Panel " ), KeyModifierMask:: ALT | Key::N) );
2459+ EditorDockManager::get_singleton ()->add_dock ( anim_editor);
24492460}
24502461
24512462AnimationPlayerEditorPlugin::~AnimationPlayerEditorPlugin () {
0 commit comments