Add **Animation Instance Data node to Anim Graph** for caching value per-model

This commit is contained in:
Wojtek Figat
2023-02-14 12:39:58 +01:00
parent 77e19e148b
commit 835127ac21
4 changed files with 42 additions and 3 deletions

View File

@@ -2035,10 +2035,22 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu
}
break;
}
// Animation Instance Data
case 33:
{
auto& bucket = context.Data->State[node->BucketIndex].InstanceData;
if (bucket.Init)
{
bucket.Init = false;
*(Float4*)bucket.Data = (Float4)tryGetValue(node->GetBox(1), Value::Zero);
}
value = *(Float4*)bucket.Data;
break;
}
default:
break;
}
context.ValueCache.Add(boxBase, value);
context.ValueCache[boxBase] = value;
}
void AnimGraphExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value& value)