Give access to node inputs in runtime graph, initial works for marking of active nodes.

This commit is contained in:
Martin Felis
2022-02-19 00:25:51 +01:00
parent 9069a8192b
commit bd304bde4e
3 changed files with 69 additions and 7 deletions
+9 -3
View File
@@ -5,6 +5,8 @@
#include "AnimGraphResource.h"
#include "catch.hpp"
using namespace AnimGraphCode;
TEST_CASE("BasicGraph", "[AnimGraphResource]") {
AnimGraphResource graph_resource;
@@ -100,9 +102,10 @@ TEST_CASE("BasicGraph", "[AnimGraphResource]") {
CHECK(graph.m_node_inputs[anim_sampler_index0].size() == 0);
CHECK(graph.m_node_inputs[anim_sampler_index1].size() == 0);
CHECK(graph.m_node_inputs[blend_index].size() == 2);
CHECK(graph.m_node_inputs[blend_index][0] == anim_sampler_instance0);
CHECK(graph.m_node_inputs[blend_index][1] == anim_sampler_instance1);
CHECK(graph.m_node_inputs[blend_index].size() == 3);
CHECK(graph.m_node_inputs[blend_index][0].m_node == anim_sampler_instance0);
CHECK(graph.m_node_inputs[blend_index][1].m_node == anim_sampler_instance1);
CHECK(graph.m_node_inputs[blend_index][2].m_node == nullptr);
}
TEST_CASE("InputAttributeConversion", "[AnimGraphResource]") {
@@ -324,12 +327,15 @@ TEST_CASE("GraphInputOutputConnectivity", "[AnimGraphResource]") {
AnimData* graph_input0 = (AnimData*) anim_graph.GetInput("GraphAnimInput0");
REQUIRE(graph_input0 == &blend2_node->m_input0);
REQUIRE(anim_graph.m_nodes[1] == anim_graph.getAnimNodeForInput(blend2_node_index, "Input0"));
AnimData* graph_input1 = (AnimData*) anim_graph.GetInput("GraphAnimInput1");
REQUIRE(graph_input1 == &blend2_node->m_input1);
REQUIRE(anim_graph.m_nodes[1] == anim_graph.getAnimNodeForInput(blend2_node_index, "Input1"));
AnimData* graph_output = (AnimData*) anim_graph.GetOutput("GraphAnimOutput");
REQUIRE(graph_output == blend2_node->m_output);
REQUIRE(anim_graph.m_nodes[blend2_node_index] == anim_graph.getAnimNodeForInput(0, "GraphAnimOutput"));
}
}
}