瀏覽代碼

Merge pull request #30527 from bojidar-bg/29436-timescale-node-uneditable

Fix AnimationTree editor messing up parameters when nested
Rémi Verschelde 6 年之前
父節點
當前提交
3045697e4b

+ 1 - 3
editor/plugins/animation_blend_tree_editor_plugin.cpp

@@ -878,9 +878,7 @@ void AnimationNodeBlendTreeEditor::edit(const Ref<AnimationNode> &p_node) {
 		blend_tree->disconnect("removed_from_graph", this, "_removed_from_graph");
 	}
 
-	if (p_node.is_valid()) {
-		blend_tree = p_node;
-	}
+	blend_tree = p_node;
 
 	if (blend_tree.is_null()) {
 		hide();

+ 3 - 2
editor/plugins/animation_tree_editor_plugin.cpp

@@ -115,6 +115,8 @@ void AnimationTreeEditor::edit_path(const Vector<String> &p_path) {
 			button_path.push_back(p_path[i]);
 		}
 
+		edited_path = button_path;
+
 		for (int i = 0; i < editors.size(); i++) {
 			if (editors[i]->can_edit(node)) {
 				editors[i]->edit(node);
@@ -126,10 +128,9 @@ void AnimationTreeEditor::edit_path(const Vector<String> &p_path) {
 		}
 	} else {
 		current_root = 0;
+		edited_path = button_path;
 	}
 
-	edited_path = button_path;
-
 	_update_path();
 }