WIP: Investigating crash on node connection.

This commit is contained in:
Martin Felis 2026-02-25 18:33:44 +01:00
parent 4a2ef2493d
commit 6db99d126b

View File

@ -597,6 +597,32 @@ 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));
}
}
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") {