summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-12-18 09:06:57 +0100
committerGitHub <noreply@github.com>2018-12-18 09:06:57 +0100
commit75c6ad97561636767aba306f977bee590c3e7620 (patch)
tree7910ecfc78da05d4e43a3bea41102a34b91e5304 /editor
parent8af4ce983266d2bcdfce83a6f2888b7c49ba443f (diff)
parent317561863da8d1909e3f2e1001e0d082e89dcbbf (diff)
Merge pull request #24427 from guilhermefelipecgs/fix_bread_crumb
Fix bread crumb of AnimationTree
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/animation_tree_editor_plugin.cpp27
1 files changed, 6 insertions, 21 deletions
diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp
index 2f3eb2f552..387a254c4f 100644
--- a/editor/plugins/animation_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_tree_editor_plugin.cpp
@@ -64,28 +64,9 @@ void AnimationTreeEditor::edit(AnimationTree *p_tree) {
void AnimationTreeEditor::_path_button_pressed(int p_path) {
- Ref<AnimationNode> node = tree->get_tree_root();
- if (node.is_null())
- return;
-
edited_path.clear();
- if (p_path >= 0) {
- for (int i = 0; i <= p_path; i++) {
- Ref<AnimationNode> child = node->get_child_by_name(button_path[i]);
- ERR_BREAK(child.is_null());
- node = child;
- edited_path.push_back(button_path[i]);
- }
- }
-
- for (int i = 0; i < editors.size(); i++) {
- if (editors[i]->can_edit(node)) {
- editors[i]->edit(node);
- editors[i]->show();
- } else {
- editors[i]->edit(Ref<AnimationNode>());
- editors[i]->hide();
- }
+ for (int i = 0; i <= p_path; i++) {
+ edited_path.push_back(button_path[i]);
}
}
@@ -176,6 +157,10 @@ void AnimationTreeEditor::_notification(int p_what) {
if (root != current_root) {
edit_path(Vector<String>());
}
+
+ if (button_path.size() != edited_path.size()) {
+ edit_path(edited_path);
+ }
}
}