* 14.3 MB: Reserve space in CurvePoseSourceIndices members in AnimNode_BoneMask and AnimNode_LayeredBoneBlend based on the exact amount used. Many nodes don't use this feature, so the array ends up empty, but in other cases, less than 5% of the reserve is used.
* 3.4 MB: Eliminate Reserve for QueuedTransitionEvents member in AnimNode_StateMachine. Reserve is wasteful because it's deleted anyway by a Shrink call in FAnimNode_StateMachine::Update_AnyThread for active state machines, and only ends up sticking around for inactive state machines, where it's irrelevant, so it doesn't affect performance to take this out.
#rnx
#rb thomas.sarkanen jose.villarroel
[CL 29601012 by jason hoerner in ue5-main branch]
Implemented ISPC versions of missing layered blend per bone hot paths.
Tweaked inlining and added ptr RESTRICT to various curve operations
Removed array copy in control rig node curve outputs
Increased inline alloc size of cached poses to reduce allocations
Removed refpose copies and allocations with linked anim graphs (these can be skipped now the bone containers are all centralized)
#rb Nicholas.Frechette,Jurre.deBaare
#tests Juno, NoMcp
[CL 28371404 by thomas sarkanen in ue5-main branch]
Runtime notes:
- Removes 'smart name' usage across the animation systems.
- Changed curve blending from a uniform array (sized per skeleton) to a sparse array of sorted named values. Blends and other combiners are performed using a dual iteration 'tape merge'.
- Skeleton curves are no longer guaranteed to cover all curve names that can be found at runtime.
Editor notes:
- Curve metadata (flags, bone links etc.) is still present on the skeleton, but can also now exist on a skeletal mesh
- Curve metadata (for morph targets) is still populated on import
- Curves can now be used arbitrarily at runtime
New features:
- New Find/Replace dialog that allows for batch-replacing curves and notifies across all of a project's assets
- New curve debugger tab in various Persona editors that allows for viewing curve values live. This also now allows viewing curves for specific pose watches.
- Pose watches now output curve tracks to the Rewind Debugger
#rb Jurre.deBaare,Nicholas.Frechette,Sara.Schvartzman,Helge.Mathee,Kiaran.Ritchie,Jaime.Cifuentes,Martin.Wilson,Keith.Yerex,Andrean.Franc (and more!)
#jira UE-167776
#jira UE-173716
#jira UE-110407
#preflight 63fc98c81206d91a2bc3ab90
#preflight 63f3ad4f81646f1f24c240c2
[CL 24421496 by Thomas Sarkanen in ue5-main branch]
Before:
3648 unity files
Total CPU Time: 47886.140625 s
Total time in Parallel executor: 498.81 seconds
After:
3548 unity files
Total CPU Time: 46643.828125 s
Total time in Parallel executor: 486.06 seconds
#jira
#preflight
[CL 22173263 by marc audy in ue5-main branch]
Enables use of layered blends in template animation blueprints
#jira UE-137671
#rb Jose Villarroel
#preflight 632c74aca4769ad714ac21c8
[CL 22145944 by thomas sarkanen in ue5-main branch]
#jira UE-149026
#fix rely on bHasRelevantPoses=false to skip evaluating poses rather than zero-ing out the blendweight array - that way they are also 'cached' for when the node becomes relevant again given the LOD
#rb Thomas.Sarkanen
#preflight 6315e12c2b7fe03eb6286b1c
[CL 21790994 by Jurre deBaare in ue5-main branch]
Introduces a serial number to FBoneContainer that allows easier refreshing of bone-relative data. Eventually the overall CacheBones path could be superseded with lazy-update systems based on this serial number.
#jira UE-116464 - Layered blend per bone crash
#rb Jurre.deBaare
[CL 16466917 by Thomas Sarkanen in ue5-main branch]
This can cause crashes in certain graph configurations (e.g. when within a state machine, Initialize can be called without a CacheBones call directly afterwards)
#rb Jurre.deBaare
[CL 16112742 by Thomas Sarkanen in ue5-main branch]
+ Attribute structures to UAnimDataModel
* These are sampled/copied into AnimSequence whenever they change
+ Attribute related Notifies and Payloads
+ Controller API and Actions for Attribute related behaviour
+ Type traits (TAttributeTypeTraitsBase) to determine support functionality for user-defined attribute types
+ TAttributeContainer equivalent to TCustomAttributes, used for keeping track of attributes at runtime in a TMap similar fashion
* Has two exported specializations FStack/Heap-AttributeContainer
+ IAttributeBlendOperator interface used for Attribute related operations in Anim graph
* Allows for user-defined blending behaviour for their associated types
+ TAttributeBlendOperator providing out-of-the-box blending behaviour for user-defined types
+ FAttributeBlendData helper structure, this encapsulates and abstracts the blend / attribute operations
* Exposes two iterators, allowing BlendOperator to loop through (type) overlapping Attributes and unique attributes
+ Float/Integer/String Animation Attribute structures used to support legacy TVariant CustomAttribute data types
+ Transform animation attribute structure to add support for single-FTransform based attributes
+ FAnimationAttributeIdentifier identifier used to reference an attribute in a script-friendly manor
+ AttributeTypes static API for registering Attribute types
+ FAttributeCurve providing a curve-type with an Attribute type as its underlying key-value
+ TWrappedAttribute helper structure to wrap end template operate on raw memory (TArray buffer)
+ Added tests for
* Attribute related controller functionality and actions
* Attribute curve key reduction
* Evaluating attributes from AnimSequence
* Attribute operations (blend, accumulate etc)
* Functional testing for blendspace attribute evaluation and blending
* Changed default attribute blend type to Blend vs Override
* Updated FBX import/export paths to handle and use new Attribute data structures
* Attribute data is now incorporated into animation source data DDC key
* Deprecated Custom Attributes stored on AnimSequence get converted into their equivalent Attribute structures
* Deprecated all previous CustomAttribute structures, APIs and files
* Corrected some comments in UAnimDataController.h
* Updated existing custom attribute tests to adhere to new blend expectations/behaviour
* Updated AnimSequence resize tests to also incorporate an attribute curve
* Changed layered bone blend to use .5 blend weight vs 1.0 to cover more behaviour
* Added transform attribute used to compare against bone transform during pre-existing functional testing (blended only)
- Deleted CustomAttributes details customization
#rb Thomas.Sarkanen
#fyi kiaran.ritchie, koray.hagen, timothy.daoust
[CL 15568420 by Jurre deBaare in ue5-main branch]
-Added option to blend profile picker for blend mask creation.
-Fixed issue w/ Blend profile picker sometimes showing in non-standalone mode outside of skeleton editor.
-Fixed issue w/ reset to default w/ blend profiles.
-Added blend mask mode to layered blend per bone node
#jira UE-101586
#review-14761881 @Aaron.Cox, @John.VanDerBurg, @Thomas.Sarkanen
[CL 14798723 by jose villarroel in ue5-main branch]
#rnx
#rb none
#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)
[CL 10870549 by ryan durand in Main branch]
A collection of major and minor optimizations to anim instance initialization.
Major:
- Added defered root node init. When an anim instance is set to init to refpose, this defers the first call to initialize the blend tree until just before the first Update() call, on a worker thread.
- Skip ConditionallyCacheBonesForState in state machines in the case where we would call CacheBones_AnyThread during first Initialize_AnyThread. This avoids duplicate work being done, as graph traversal counters will let through sychronization calls if they have yet to be updated (ie. their count is INDEX_NONE).
- Cache access to nodes that need pre-update, dynamic reset, one-time initialization, as well as state machines in the generated class to avoid iterating all anim nodes on initialization.
Minor:
- Cache access to node properties when re-linking nodes to avoid duplicate memory round-trips.
- Cache access to LUT size in FBaseBlendedCurve::GetValidElementCount, avoiding duplicate memory round-trips.
- Prevent FName rehashing from string (intended to strip whitespace) when initializing FBoneReferences.
- Cache access to AnimCurveMapping smart name container on USkeleton, preventing a TMap lookup every time we access the smart name container.
- USkeleton::GetCurveMetaData now uses a 'fast path' when accessing using smart name UID. In this case we can avoid the TMap lookup as the UID is always a direct index to metadata at runtime (slow path still applies in editor builds).
- Avoid calling FAnimNode_LayeredBoneBlend::ReinitializeBoneBlendWeights in Initialize_AnyThread, as CacheBones_AnyThread will be called straight after anyways.
- Cache access to curve UID count and LinkedBones array in FAnimNode_LayeredBoneBlend::ReinitializeBoneBlendWeights, avoiding duplicate memory round-trips.
Upgrade notes:
- Breaking change! Custom anim nodes that implement OnInitializeAnimInstance now need to return true for the new accessor NeedsOnInitializeAnimInstance to be called at init time.
- The meaning of HasPreUpdate and NeedsDynamicReset has changed slightly. Previously these were called at init time, so if their results were mutable it was possible to re-init an anim instance with new settings. Now they are called at CDO load time this is no longer possible.
#rb Martin.Wilson
#ROBOMERGE-SOURCE: CL 8686415 via CL 8686419 via CL 8689513
#ROBOMERGE-BOT: (v422-8689730)
[CL 8695271 by thomas sarkanen in Main branch]
Merging using Fortnite_Main<->Fortnite_ControlRig
#rb none
#ROBOMERGE-OWNER: helge.mathee
#ROBOMERGE-AUTHOR: helge.mathee
#ROBOMERGE-SOURCE: CL 7321580 via CL 7323175
#ROBOMERGE-BOT: (v371-7306989)
[CL 7323351 by helge mathee in Main branch]
[CODEREVIEW] Lina.Halper, Laurent.Delayen, Aaron.Cox
#rnx
#ROBOMERGE-SOURCE: CL 7014082 via CL 7016740 via CL 7016747 via CL 7016816 via CL 7020855
#ROBOMERGE-BOT: (v367-6836689)
[CL 7020952 by braeden shosa in Main branch]
Useful for fixing scaling issues arising from "Layered blend per bone" node. For example, when blending lower body locomotion with upper body aiming and feathering the lower body weight up the spine, scaling on the spine can propogate through the skeleton to the hands causing them to drift from the weapon. This removes the need to manually fixup the spine's scale after blending the poses.
BlendMeshPosesPerBoneWeights and BlendLocalPosesPerBoneWeights are now folded into a single function: BlendPosesPerBoneFilter.
[CODEREVIEW] Lina.Halper, Laurent.Delayen, Aaron.Cox
#rns
#ROBOMERGE-SOURCE: CL 6661692 via CL 6661829
#ROBOMERGE-BOT: (vundefined-6654089)
[CL 6661835 by braeden shosa in Main branch]
#rb: Martin.Wilson
#jira: FORT-113893
#ROBOMERGE-SOURCE: CL 5768200 via CL 5768201 via CL 5768840 via CL 5770648
[CL 5770764 by lina halper in Main branch]