Files

211 lines
6.8 KiB
C++
Raw Permalink Normal View History

Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox [CL 16703644 by Thomas Sarkanen in ue5-main branch]
2021-06-17 08:58:34 -04:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "SequencePlayerLibrary.h"
#include "Animation/AnimNode_Inertialization.h"
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox [CL 16703644 by Thomas Sarkanen in ue5-main branch]
2021-06-17 08:58:34 -04:00
#include "Animation/AnimNode_SequencePlayer.h"
#include "Animation/AnimTrace.h"
#include "Animation/AnimInstanceProxy.h"
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox [CL 16703644 by Thomas Sarkanen in ue5-main branch]
2021-06-17 08:58:34 -04:00
#include UE_INLINE_GENERATED_CPP_BY_NAME(SequencePlayerLibrary)
DEFINE_LOG_CATEGORY_STATIC(LogSequencePlayerLibrary, Verbose, All);
FSequencePlayerReference USequencePlayerLibrary::ConvertToSequencePlayer(const FAnimNodeReference& Node, EAnimNodeReferenceConversionResult& Result)
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox [CL 16703644 by Thomas Sarkanen in ue5-main branch]
2021-06-17 08:58:34 -04:00
{
return FAnimNodeReference::ConvertToType<FSequencePlayerReference>(Node, Result);
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox [CL 16703644 by Thomas Sarkanen in ue5-main branch]
2021-06-17 08:58:34 -04:00
}
FSequencePlayerReference USequencePlayerLibrary::SetAccumulatedTime(const FSequencePlayerReference& SequencePlayer, float Time)
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox [CL 16703644 by Thomas Sarkanen in ue5-main branch]
2021-06-17 08:58:34 -04:00
{
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("SetAccumulatedTime"),
[Time](FAnimNode_SequencePlayer& InSequencePlayer)
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox [CL 16703644 by Thomas Sarkanen in ue5-main branch]
2021-06-17 08:58:34 -04:00
{
InSequencePlayer.SetAccumulatedTime(Time);
});
return SequencePlayer;
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox [CL 16703644 by Thomas Sarkanen in ue5-main branch]
2021-06-17 08:58:34 -04:00
}
FSequencePlayerReference USequencePlayerLibrary::SetStartPosition(const FSequencePlayerReference& SequencePlayer, float StartPosition)
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox [CL 16703644 by Thomas Sarkanen in ue5-main branch]
2021-06-17 08:58:34 -04:00
{
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("SetStartPosition"),
[StartPosition](FAnimNode_SequencePlayer& InSequencePlayer)
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox [CL 16703644 by Thomas Sarkanen in ue5-main branch]
2021-06-17 08:58:34 -04:00
{
if(!InSequencePlayer.SetStartPosition(StartPosition))
{
UE_LOG(LogSequencePlayerLibrary, Warning, TEXT("Could not set start position on sequence player, value is not dynamic. Set it as Always Dynamic."));
}
});
return SequencePlayer;
}
FSequencePlayerReference USequencePlayerLibrary::SetPlayRate(const FSequencePlayerReference& SequencePlayer, float PlayRate)
{
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("SetPlayRate"),
[PlayRate](FAnimNode_SequencePlayer& InSequencePlayer)
{
if(!InSequencePlayer.SetPlayRate(PlayRate))
{
UE_LOG(LogSequencePlayerLibrary, Warning, TEXT("Could not set play rate on sequence player, value is not dynamic. Set it as Always Dynamic."));
}
});
return SequencePlayer;
}
FSequencePlayerReference USequencePlayerLibrary::SetSequence(const FSequencePlayerReference& SequencePlayer, UAnimSequenceBase* Sequence)
{
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("SetSequence"),
[Sequence](FAnimNode_SequencePlayer& InSequencePlayer)
{
if(!InSequencePlayer.SetSequence(Sequence))
{
UE_LOG(LogSequencePlayerLibrary, Warning, TEXT("Could not set sequence on sequence player, value is not dynamic. Set it as Always Dynamic."));
}
});
return SequencePlayer;
}
FSequencePlayerReference USequencePlayerLibrary::SetSequenceWithInertialBlending(const FAnimUpdateContext& UpdateContext, const FSequencePlayerReference& SequencePlayer, UAnimSequenceBase* Sequence, float BlendTime)
{
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("SetSequenceWithInterialBlending"),
[Sequence, &UpdateContext, BlendTime](FAnimNode_SequencePlayer& InSequencePlayer)
{
const UAnimSequenceBase* CurrentSequence = InSequencePlayer.GetSequence();
const bool bAnimSequenceChanged = (CurrentSequence != Sequence);
if(!InSequencePlayer.SetSequence(Sequence))
{
UE_LOG(LogSequencePlayerLibrary, Warning, TEXT("Could not set sequence on sequence player, value is not dynamic. Set it as Always Dynamic."));
}
if(bAnimSequenceChanged && BlendTime > 0.0f)
{
if (const FAnimationUpdateContext* AnimationUpdateContext = UpdateContext.GetContext())
{
if (UE::Anim::IInertializationRequester* InertializationRequester = AnimationUpdateContext->GetMessage<UE::Anim::IInertializationRequester>())
{
FInertializationRequest Request;
Request.Duration = BlendTime;
#if ANIM_TRACE_ENABLED
Request.NodeId = AnimationUpdateContext->GetCurrentNodeId();
Request.AnimInstance = AnimationUpdateContext->AnimInstanceProxy->GetAnimInstanceObject();
#endif
InertializationRequester->RequestInertialization(Request);
}
}
else
{
UE_LOG(LogSequencePlayerLibrary, Warning, TEXT("SetSequenceWithInertialBlending called with invalid context"));
}
}
});
return SequencePlayer;
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
}
FSequencePlayerReference USequencePlayerLibrary::GetSequence(const FSequencePlayerReference& SequencePlayer, UAnimSequenceBase*& SequenceBase)
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
{
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("GetSequence"),
[&SequenceBase](FAnimNode_SequencePlayer& InSequencePlayer)
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
{
SequenceBase = InSequencePlayer.GetSequence();
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
});
return SequencePlayer;
}
UAnimSequenceBase* USequencePlayerLibrary::GetSequencePure(const FSequencePlayerReference& SequencePlayer)
{
UAnimSequenceBase* SequenceBase = nullptr;
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("GetSequence"),
[&SequenceBase](FAnimNode_SequencePlayer& InSequencePlayer)
{
SequenceBase = InSequencePlayer.GetSequence();
});
return SequenceBase;
}
float USequencePlayerLibrary::GetAccumulatedTime(const FSequencePlayerReference& SequencePlayer)
{
float AccumulatedTime = 0.f;
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("GetAccumulatedTime"),
[&AccumulatedTime](FAnimNode_SequencePlayer& InSequencePlayer)
{
AccumulatedTime = InSequencePlayer.GetAccumulatedTime();
});
return AccumulatedTime;
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
}
float USequencePlayerLibrary::GetStartPosition(const FSequencePlayerReference& SequencePlayer)
{
float StartPosition = 0.f;
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("GetStartPosition"),
[&StartPosition](FAnimNode_SequencePlayer& InSequencePlayer)
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
{
StartPosition = InSequencePlayer.GetStartPosition();
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
});
return StartPosition;
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
}
float USequencePlayerLibrary::GetPlayRate(const FSequencePlayerReference& SequencePlayer)
{
float PlayRate = 1.f;
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("GetPlayRate"),
[&PlayRate](FAnimNode_SequencePlayer& InSequencePlayer)
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
{
PlayRate = InSequencePlayer.GetPlayRate();
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
});
return PlayRate;
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
}
bool USequencePlayerLibrary::GetLoopAnimation(const FSequencePlayerReference& SequencePlayer)
{
bool bLoopAnimation = false;
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("GetLoopAnimation"),
[&bLoopAnimation](FAnimNode_SequencePlayer& InSequencePlayer)
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
{
bLoopAnimation = InSequencePlayer.IsLooping();
#preflight 6143ef4681695600011c49a8 #rb braeden.shosa, aaron.cox, cesar.castro #jira none Motion Trajectory Component for Motion Matching: Motion Trajectory Component notes: 1) Abstract component/interface implemented with prediction and history API. 2) Implemented uniform, frame-rate independent history sampling algorithm for retaining trajectory sample coherence. 3) Implemented concrete Character Movement Trajectory Component for encapsulating ground locomotion prediction algorithm and API. 4) Motion Trajectory blueprint library containing: 5) FlattenTrajectory2D algorithm for isolating and removing Z axis direction contribution from tracjectory. 6) ClampTrajectoryDirection for projecting trajectory samples into a discrete, allowed set of directions (such as cardinal). Engine changes: 1) Implemented shared TrajectorySample, Range, and Domain structures for common usage among Motion Trajectory, Pose Search, and Blueprint. 2) Expanded Sequence Player blueprint library functionality for Scripted Motion Matching content example. Pose Search changes: 1) Match Pose renamed to Pose History with minor configuration parameters. 2) Complete removal of approximated past trajectory sampling. This has now been pushed to the Motion Trajectory Component. 3) Motion Matching interface changes: Goal has been replaced with Trajectory and Dynamic Play Rate Adjustment has been encapsulated to an experimental code module and blueprint library. New defaults, and encapsulating settings. 4) Motion Matching changes: New Pose Search blueprint library which encapsulates core Motion Matching algorithm. 5) Unified Trajectory to Pose Feature Vector transformation algorithms. 6) Removal of temporary Pose Search Prediction blueprint library (now Dynamic Play Rate). 7) End-to-end implementation support for Past/Future Time and Distance domain schemas. AnimInput changes: 1) Removal of AnimInput_CapsulePrediction (replaced with Motion Trajectory Component). Gameplay Anim Gym changes: 1) Pose search database is now fully distance-based (history and future). 2) Character blueprint includes Character Movement Trajectory Component with distance-based domain setup. 3) Scripted Motion Matching anim node function prototype with Engine content example. #preflight 6143ef4681695600011c49a8 [CL 17547347 by koray hagen in ue5-main branch]
2021-09-16 22:34:04 -04:00
});
return bLoopAnimation;
}
float USequencePlayerLibrary::ComputePlayRateFromDuration(const FSequencePlayerReference& SequencePlayer, float Duration /* = 1.0f */)
{
float PlayRate = 1.f;
if (Duration > 0.f)
{
SequencePlayer.CallAnimNodeFunction<FAnimNode_SequencePlayer>(
TEXT("GetPlayRate"),
[&PlayRate, Duration](const FAnimNode_SequencePlayer& InSequencePlayer)
{
if (const UAnimSequenceBase* Sequence = InSequencePlayer.GetSequence())
{
PlayRate = Sequence->GetPlayLength() / Duration;
}
});
}
return PlayRate;
}