Mark all nodes that connect to the graph output nodes by default as active.

AnimGraphEditor
Martin Felis 2022-02-20 16:00:45 +01:00
parent b01acc2a88
commit 87eb2ab7df
1 changed files with 8 additions and 4 deletions

View File

@ -389,11 +389,15 @@ void AnimGraph::UpdateOrderedNodes() {
void AnimGraph::MarkActiveNodes() { void AnimGraph::MarkActiveNodes() {
m_frame_counter++; m_frame_counter++;
int first_node_index = getAnimNodeIndex(m_ordered_nodes[0]); const std::vector<AnimNodeInput> graph_output_inputs = m_node_inputs[0];
m_ordered_nodes[0]->m_frame_counter = m_frame_counter; for (size_t i = 0, n = graph_output_inputs.size(); i < n; i++) {
m_ordered_nodes[0]->UpdateActiveInputFrameCounters(m_node_inputs[first_node_index]); AnimNode* node = m_ordered_nodes[i];
if (node != nullptr) {
node->m_frame_counter = m_frame_counter;
}
}
for (size_t i = 1, n = m_ordered_nodes.size(); i < n; i++) { for (size_t i = 0, n = m_ordered_nodes.size(); i < n; i++) {
AnimNode* node = m_ordered_nodes[i]; AnimNode* node = m_ordered_nodes[i];
if (CheckIsNodeActive(node)) { if (CheckIsNodeActive(node)) {
int node_index = getAnimNodeIndex(node); int node_index = getAnimNodeIndex(node);