| 477 | } |
| 478 | |
| 479 | VisjectExecutor::Value AnimGraphExecutor::eatBox(Node* caller, Box* box) |
| 480 | { |
| 481 | auto& context = *Context.Get(); |
| 482 | |
| 483 | // Check if graph is looped or is too deep |
| 484 | if (context.StackOverFlow) |
| 485 | return Value::Zero; |
| 486 | if (context.CallStack.Count() >= ANIM_GRAPH_MAX_CALL_STACK) |
| 487 | { |
| 488 | OnError(caller, box, TEXT("Graph is looped or too deep!")); |
| 489 | context.StackOverFlow = true; |
| 490 | return Value::Zero; |
| 491 | } |
| 492 | #if !BUILD_RELEASE |
| 493 | if (box == nullptr) |
| 494 | { |
| 495 | OnError(caller, box, TEXT("Null graph box!")); |
| 496 | return Value::Zero; |
| 497 | } |
| 498 | #endif |
| 499 | |
| 500 | // Add to the calling stack |
| 501 | context.CallStack.Add(caller); |
| 502 | |
| 503 | #if USE_EDITOR |
| 504 | Animations::DebugFlowInfo flowInfo; |
| 505 | flowInfo.Asset = _graph._owner; |
| 506 | flowInfo.Instance = context.Data->Object; |
| 507 | flowInfo.NodeId = box->GetParent<Node>()->ID; |
| 508 | flowInfo.BoxId = box->ID; |
| 509 | const auto* nodePath = context.NodePath.Get(); |
| 510 | for (int32 i = 0; i < context.NodePath.Count(); i++) |
| 511 | flowInfo.NodePath[i] = nodePath[i]; |
| 512 | Animations::DebugFlow(flowInfo); |
| 513 | #endif |
| 514 | |
| 515 | // Call per group custom processing event |
| 516 | Value value; |
| 517 | const auto parentNode = box->GetParent<Node>(); |
| 518 | const ProcessBoxHandler func = _perGroupProcessCall[parentNode->GroupID]; |
| 519 | (this->*func)(box, parentNode, value); |
| 520 | |
| 521 | // Remove from the calling stack |
| 522 | context.CallStack.RemoveLast(); |
| 523 | |
| 524 | return value; |
| 525 | } |
| 526 | |
| 527 | VisjectExecutor::Graph* AnimGraphExecutor::GetCurrentGraph() const |
| 528 | { |
nothing calls this directly
no test coverage detected