Only storing single socket in AnimGraphConnections and simplified wiring logic.
This commit is contained in:
@@ -62,7 +62,8 @@ void AnimGraphBlendTree::UpdateOrderedNodesRecursive(int node_index) {
|
||||
}
|
||||
}
|
||||
|
||||
void AnimGraphBlendTree::MarkActiveInputs(const std::vector<AnimGraphConnection>& input_connections) {
|
||||
void AnimGraphBlendTree::MarkActiveInputs(
|
||||
const std::vector<AnimGraphConnection>& input_connections) {
|
||||
for (size_t i = 0, n = m_nodes.size(); i < n; i++) {
|
||||
if (m_nodes[i]->m_tick_number != m_tick_number) {
|
||||
m_nodes[i]->m_state = AnimNodeEvalState::Deactivated;
|
||||
@@ -93,8 +94,7 @@ void AnimGraphBlendTree::MarkActiveInputs(const std::vector<AnimGraphConnection>
|
||||
const AnimGraphConnection& input =
|
||||
m_node_input_connections[node_index][j];
|
||||
if (input.m_source_node != nullptr
|
||||
&& input.m_target_socket.m_type
|
||||
!= SocketType::SocketTypeAnimation) {
|
||||
&& input.m_socket.m_type != SocketType::SocketTypeAnimation) {
|
||||
input.m_source_node->m_state = AnimNodeEvalState::Activated;
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,8 @@ void AnimGraphBlendTree::MarkActiveInputs(const std::vector<AnimGraphConnection>
|
||||
}
|
||||
}
|
||||
|
||||
void AnimGraphBlendTree::CalcSyncTrack(const std::vector<AnimGraphConnection>& input_connections) {
|
||||
void AnimGraphBlendTree::CalcSyncTrack(
|
||||
const std::vector<AnimGraphConnection>& input_connections) {
|
||||
for (size_t i = m_eval_ordered_nodes.size() - 1; i >= 0; i--) {
|
||||
AnimNode* node = m_eval_ordered_nodes[i];
|
||||
if (node->m_state == AnimNodeEvalState::Deactivated) {
|
||||
@@ -162,54 +163,10 @@ void AnimGraphBlendTree::PropagateTimeToNodeInputs(const AnimNode* node) {
|
||||
|
||||
// Only propagate time updates via animation sockets.
|
||||
if (input_node != nullptr
|
||||
&& node_input_connections[i].m_target_socket.m_type
|
||||
&& node_input_connections[i].m_socket.m_type
|
||||
== SocketType::SocketTypeAnimation
|
||||
&& input_node->m_state == AnimNodeEvalState::Activated) {
|
||||
input_node->UpdateTime(node_time_last, node_time_now);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Socket* AnimGraphBlendTree::GetInputSocket(const std::string& name) {
|
||||
for (size_t i = 0, n = m_node_output_connections[1].size(); i < n; i++) {
|
||||
AnimGraphConnection& connection = m_node_output_connections[1][i];
|
||||
if (connection.m_source_socket.m_name == name) {
|
||||
return &connection.m_source_socket;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Socket* AnimGraphBlendTree::GetOutputSocket(const std::string& name) {
|
||||
for (size_t i = 0, n = m_node_input_connections[0].size(); i < n; i++) {
|
||||
AnimGraphConnection& connection = m_node_input_connections[0][i];
|
||||
if (connection.m_target_socket.m_name == name) {
|
||||
return &connection.m_target_socket;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const Socket* AnimGraphBlendTree::GetInputSocket(const std::string& name) const {
|
||||
for (size_t i = 0, n = m_node_output_connections[1].size(); i < n; i++) {
|
||||
const AnimGraphConnection& connection = m_node_output_connections[1][i];
|
||||
if (connection.m_source_socket.m_name == name) {
|
||||
return &connection.m_source_socket;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const Socket* AnimGraphBlendTree::GetOutputSocket(const std::string& name) const {
|
||||
for (size_t i = 0, n = m_node_input_connections[0].size(); i < n; i++) {
|
||||
const AnimGraphConnection& connection = m_node_input_connections[0][i];
|
||||
if (connection.m_target_socket.m_name == name) {
|
||||
return &connection.m_target_socket;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
Reference in New Issue
Block a user