Skip to content

Commit

Permalink
Merge pull request #83534 from SaracenOne/blend_tree_auto_disconnect
Browse files Browse the repository at this point in the history
Automatic reconnection of nodes in blend tree.
  • Loading branch information
akien-mga committed Oct 18, 2023
2 parents 49f492d + 65016c3 commit f7da96a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions editor/plugins/animation_blend_tree_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ void AnimationNodeBlendTreeEditor::_connection_request(const String &p_from, int

AnimationNodeBlendTree::ConnectionError err = blend_tree->can_connect_node(p_to, p_to_index, p_from);

if (err == AnimationNodeBlendTree::CONNECTION_ERROR_CONNECTION_EXISTS) {
blend_tree->disconnect_node(p_to, p_to_index);
err = blend_tree->can_connect_node(p_to, p_to_index, p_from);
}

if (err != AnimationNodeBlendTree::CONNECTION_OK) {
EditorNode::get_singleton()->show_warning(TTR("Unable to connect, port may be in use or connection may be invalid."));
return;
Expand Down

0 comments on commit f7da96a

Please sign in to comment.