Fix anim graph crash regression
This commit is contained in:
@@ -258,17 +258,22 @@ void AnimGraphExecutor::Update(AnimGraphInstanceData& data, float dt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update the animation graph and gather skeleton nodes transformations in nodes local space
|
// Update the animation graph and gather skeleton nodes transformations in nodes local space
|
||||||
AnimGraphImpulse* animResult;
|
AnimGraphImpulse* animResult = nullptr;
|
||||||
{
|
{
|
||||||
ANIM_GRAPH_PROFILE_EVENT("Evaluate");
|
ANIM_GRAPH_PROFILE_EVENT("Evaluate");
|
||||||
|
|
||||||
auto result = eatBox((Node*)_graph._rootNode, &_graph._rootNode->Boxes[0]);
|
const Variant result = eatBox((Node*)_graph._rootNode, &_graph._rootNode->Boxes[0]);
|
||||||
if (result.Type.Type != VariantType::Pointer)
|
switch (result.Type.Type)
|
||||||
{
|
{
|
||||||
result = VariantType::Null;
|
case VariantType::Pointer:
|
||||||
LOG(Warning, "Invalid animation update result");
|
|
||||||
}
|
|
||||||
animResult = (AnimGraphImpulse*)result.AsPointer;
|
animResult = (AnimGraphImpulse*)result.AsPointer;
|
||||||
|
break;
|
||||||
|
case ValueType::Null:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LOG(Warning, "Invalid animation update result type {0}", result.Type.ToString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (animResult == nullptr)
|
if (animResult == nullptr)
|
||||||
animResult = GetEmptyNodes();
|
animResult = GetEmptyNodes();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -588,6 +588,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu
|
|||||||
// Animation Output
|
// Animation Output
|
||||||
case 1:
|
case 1:
|
||||||
value = tryGetValue(box, Value::Null);
|
value = tryGetValue(box, Value::Null);
|
||||||
|
break;
|
||||||
// Animation
|
// Animation
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user