Add support for overriding Anim Graph output for Animated Model

This commit is contained in:
Wojtek Figat
2021-11-03 12:25:31 +01:00
parent bd531aa6c2
commit f6e8596e91
2 changed files with 10 additions and 2 deletions

View File

@@ -273,6 +273,9 @@ void AnimGraphExecutor::Update(AnimGraphInstanceData& data, float dt)
animResult = GetEmptyNodes();
}
// Allow for external override of the local pose (eg. by the ragdoll)
data.LocalPoseOverride(animResult);
// Calculate the global poses for the skeleton nodes
{
ANIM_GRAPH_PROFILE_EVENT("Global Pose");

View File

@@ -75,7 +75,7 @@ struct RootMotionData
/// Container for skeleton nodes transformation hierarchy and any other required data.
/// Unified layout for both local and model transformation spaces.
/// </summary>
struct AnimGraphImpulse
struct FLAXENGINE_API AnimGraphImpulse
{
/// <summary>
/// The skeleton nodes transformation hierarchy nodes. Size always matches the Anim Graph skeleton description.
@@ -245,7 +245,7 @@ public:
/// <summary>
/// The animation graph instance data storage. Required to update the animation graph.
/// </summary>
class AnimGraphInstanceData
class FLAXENGINE_API AnimGraphInstanceData
{
public:
@@ -347,6 +347,11 @@ public:
/// </summary>
ScriptingObject* Object;
/// <summary>
/// The custom event called after local pose evaluation.
/// </summary>
Delegate<AnimGraphImpulse*> LocalPoseOverride;
public:
/// <summary>