Compare commits

..

No commits in common. "6db99d126b3560b3743701c58912dc9393d97231" and "d57fe50d5fc00e2a96ead41feb14c0e566633bce" have entirely different histories.

View File

@ -520,7 +520,7 @@ TEST_CASE_FIXTURE(BlendTreeFixture, "[SceneTree][Blendalot][BlendTreeGraph][Chan
CHECK(subgraph_blend2a_initial == blend_tree_graph.node_connection_info[blend_tree_graph.find_node_index(blend2_node_a)].input_subtree_node_indices); CHECK(subgraph_blend2a_initial == blend_tree_graph.node_connection_info[blend_tree_graph.find_node_index(blend2_node_a)].input_subtree_node_indices);
CHECK(subgraph_blend2b_initial == blend_tree_graph.node_connection_info[blend_tree_graph.find_node_index(blend2_node_b)].input_subtree_node_indices); CHECK(subgraph_blend2b_initial == blend_tree_graph.node_connection_info[blend_tree_graph.find_node_index(blend2_node_b)].input_subtree_node_indices);
// Check that the connection is not present anymore. // Check that we also do not
for (const BLTBlendTreeConnection &connection : blend_tree_graph.connections) { for (const BLTBlendTreeConnection &connection : blend_tree_graph.connections) {
bool connection_equals_removed_connection = connection.source_node == blend2_node_b && connection.target_node == blend2_node_a && connection.target_port_name == "Input1"; bool connection_equals_removed_connection = connection.source_node == blend2_node_b && connection.target_node == blend2_node_a && connection.target_port_name == "Input1";
CHECK(connection_equals_removed_connection == false); CHECK(connection_equals_removed_connection == false);
@ -597,32 +597,6 @@ TEST_CASE_FIXTURE(BlendTreeFixture, "[SceneTree][Blendalot][BlendTreeGraph][Chan
CHECK(blend_tree_graph.node_connection_info[blend2_node_b_index_post_remove].input_subtree_node_indices.has(animation_sampler_node_c_index_post_remove)); CHECK(blend_tree_graph.node_connection_info[blend2_node_b_index_post_remove].input_subtree_node_indices.has(animation_sampler_node_c_index_post_remove));
} }
} }
SUBCASE("Reconnect graph") {
Ref<BLTAnimationNodeBlendTree> blend_tree_node;
blend_tree_node.instantiate();
blend_tree_node->add_node(animation_sampler_node_a);
blend_tree_node->add_node(animation_sampler_node_b);
blend_tree_node->add_node(animation_sampler_node_c);
blend_tree_node->add_node(blend2_node_a);
animation_graph->set_root_animation_node(blend_tree_node);
GraphEvaluationContext &graph_context = animation_graph->get_context();
REQUIRE(blend_tree_node->initialize(graph_context) == false);
REQUIRE(BLTAnimationNodeBlendTree::CONNECTION_OK == blend_tree_node->add_connection(animation_sampler_node_a, blend_tree_node->get_output_node(), "Output"));
REQUIRE(blend_tree_node->initialize(graph_context) == true);
REQUIRE(BLTAnimationNodeBlendTree::CONNECTION_OK == blend_tree_node->add_connection(animation_sampler_node_b, blend2_node_a, "Input0"));
REQUIRE(BLTAnimationNodeBlendTree::CONNECTION_OK == blend_tree_node->add_connection(animation_sampler_node_c, blend2_node_a, "Input1"));
REQUIRE(BLTAnimationNodeBlendTree::CONNECTION_OK == blend_tree_node->remove_connection(animation_sampler_node_a, blend_tree_node->get_output_node(), "Output"));
REQUIRE(BLTAnimationNodeBlendTree::CONNECTION_OK == blend_tree_node->add_connection(blend2_node_a, blend_tree_node->get_output_node(), "Output"));
REQUIRE(blend_tree_node->initialize(graph_context) == true);
blend_tree_graph.sort_nodes_and_references();
}
} }
TEST_CASE_FIXTURE(BlendTreeFixture, "[SceneTree][Blendalot][BlendTreeGraph][EmbeddedBlendTree] BlendTree with an embedded BlendTree subgraph") { TEST_CASE_FIXTURE(BlendTreeFixture, "[SceneTree][Blendalot][BlendTreeGraph][EmbeddedBlendTree] BlendTree with an embedded BlendTree subgraph") {