From 6db99d126b3560b3743701c58912dc9393d97231 Mon Sep 17 00:00:00 2001 From: Martin Felis Date: Wed, 25 Feb 2026 18:33:44 +0100 Subject: [PATCH] WIP: Investigating crash on node connection. --- tests/test_blendalot_animgraph.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/test_blendalot_animgraph.h b/tests/test_blendalot_animgraph.h index a06a52b..9b9c18b 100644 --- a/tests/test_blendalot_animgraph.h +++ b/tests/test_blendalot_animgraph.h @@ -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 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") {