Browse Source

Merge pull request #106334 from harrisyu/tweeak-fix-feature

Make sure clicking AnimationTree node open the state machine editor not the track editor.
Thaddeus Crews 3 months ago
parent
commit
7258540a25
1 changed files with 5 additions and 0 deletions
  1. 5 0
      editor/plugins/animation_player_editor_plugin.cpp

+ 5 - 0
editor/plugins/animation_player_editor_plugin.cpp

@@ -41,6 +41,7 @@
 #include "editor/gui/editor_file_dialog.h"
 #include "editor/gui/editor_file_dialog.h"
 #include "editor/gui/editor_validation_panel.h"
 #include "editor/gui/editor_validation_panel.h"
 #include "editor/inspector_dock.h"
 #include "editor/inspector_dock.h"
+#include "editor/plugins/animation_tree_editor_plugin.h"
 #include "editor/plugins/canvas_item_editor_plugin.h" // For onion skinning.
 #include "editor/plugins/canvas_item_editor_plugin.h" // For onion skinning.
 #include "editor/plugins/node_3d_editor_plugin.h" // For onion skinning.
 #include "editor/plugins/node_3d_editor_plugin.h" // For onion skinning.
 #include "editor/scene_tree_dock.h"
 #include "editor/scene_tree_dock.h"
@@ -2409,6 +2410,10 @@ bool AnimationPlayerEditorPlugin::handles(Object *p_object) const {
 
 
 void AnimationPlayerEditorPlugin::make_visible(bool p_visible) {
 void AnimationPlayerEditorPlugin::make_visible(bool p_visible) {
 	if (p_visible) {
 	if (p_visible) {
+		// if AnimationTree editor is visible, do not occupy the bottom panel
+		if (AnimationTreeEditor::get_singleton() && AnimationTreeEditor::get_singleton()->is_visible_in_tree()) {
+			return;
+		}
 		EditorNode::get_bottom_panel()->make_item_visible(anim_editor);
 		EditorNode::get_bottom_panel()->make_item_visible(anim_editor);
 		anim_editor->set_process(true);
 		anim_editor->set_process(true);
 		anim_editor->ensure_visibility();
 		anim_editor->ensure_visibility();