29 Commits

Author SHA1 Message Date
aaron cox
2f590aacea Add animation modifier to help fixup root motion data recorded via Take Recorder.
[REVIEW] [at]Fernando.Coello, [at]Jose.Villarroel
#preflight 6467a82e434f5536a37dd345

[CL 25553534 by aaron cox in ue5-main branch]
2023-05-19 17:58:03 -04:00
jurre debaare
a3e8a1d2fc Anim Modifiers - Can't add multiple modifiers to multiple animation sequences without the engine crashing
#jira  UE-184438
#fix prevent deadlocking when trying to cancel async animation compression task while holding onto evaluation/modification lock on current thread
#misc ensure that apply an animation modifier holds aforementioned lock
#misc add bracket to MotionExtractorModifier
#preflight 645e19df5b775f11fba5e0fe
#rb Thomas.Sarkanen

[CL 25448534 by jurre debaare in ue5-main branch]
2023-05-12 10:19:37 -04:00
jose villarroel
c39a382b8f Fix for non-unity compile error.
#rnx
#rb trivial
#preflight skip

[CL 25340584 by jose villarroel in ue5-main branch]
2023-05-04 15:22:39 -04:00
jose villarroel
921c5eb366 Expose Motion Extractor Utilities library
Make EMotionExtractor_MotionType bitmask friendly
#rnx
#preflight 6453d28f743c256cd60766ba
[REVIEW] [at]Fernando.Coello, [at]Aaron.Cox

[CL 25339780 by jose villarroel in ue5-main branch]
2023-05-04 14:52:33 -04:00
jaime cifuentes
c13768a2e4 Truncation fixes for AnimationModifierLibrary
#rb Thomas.Sarkanen
#jira UE-183905
#preflight 6443c5f1b14f1faacf6b23b2

[CL 25161777 by jaime cifuentes in ue5-main branch]
2023-04-24 06:28:57 -04:00
samuele rigamonti
2df135cfdf AnimationModifierLibrary - EncodeRootBoneModifier
#review-24543865 @fernando.coello, @aaron.cox, @roland.munguia
#preflight 64078d6d6e1dadfcda9db140

[CL 24545599 by samuele rigamonti in ue5-main branch]
2023-03-07 14:27:19 -05:00
Jurre deBaare
71d9a093fc UReOrientRootBoneModifier is causing the root bone spinning uncontrollably
#jira UE-178679
#fix Cache out new bone track keys, and set all at once, rather than trying to sample directly from the data (which changes with every loop cycle)
#rb Samuele.Rigamonti
#preflight 6400739fe96fa926fbadf55c

[CL 24496458 by Jurre deBaare in ue5-main branch]
2023-03-03 05:06:52 -05:00
Thomas Sarkanen
502797ca50 Animation Curve Runtime & Editor Improvements
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]
2023-02-27 07:20:58 -05:00
jurre debaare
7faefe7834 Crash when applying a Motion Extractor Modifier to any animation
#fix Delay adding motion curve/keys until the end of MotionExtractorModifier processing. Recently ::OnApply of an AnimationModifier has been moved to happen within a IAnimationDataController::ScopedBracket. Which means that any changes to the animation data (notifies) are only propagated at the end. The Modifier in question, added a curve and directly afterwards tried to sample the raw data (which fails)
#jira UE-176994
#preflight 63eb8dfbf36e1a5ece69d403
#rb thomas.sarkanen

[CL 24251474 by jurre debaare in ue5-main branch]
2023-02-16 01:45:45 -05:00
henrik karlsson
9a1d5b1ad4 [Engine/Plugins]
* Ran IWYU on ~170 plugins to remove includes not needed. Public api still keep old includes inside #if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2

#preflight 63d09351574ab9cae4670216
#rb none

[CL 23844750 by henrik karlsson in ue5-main branch]
2023-01-25 02:42:36 -05:00
henrik karlsson
9183978e29 [Engine/Plugins]
* Removed includes (using IWYU) in private files

#preflight 63c79978ac35a0e9dabbe408
#rb none

[CL 23770038 by henrik karlsson in ue5-main branch]
2023-01-19 00:48:07 -05:00
Jurre deBaare
31f1b097fd Animation Compression
- Added new compression and 'compiling' API/path
  * Relies on newer DDC API
  * Only fetches compressible data when data is not found in DDC
  * Fetching data happens off the GT now (including Additive animation)
- Deprecated and replace AnimSequence API around compression
** AnimStreamable still relies on old, synchronous, compression path **

IAnimationDataModel
- Removed bone track data being stored as FBoneAnimationTrack
- Bone animation can now only be referenced by Name (not track index anymore)
- Deprecated any API relying on FBoneAnimationTrack
- Added API to retrieve FTransform(s) for given frame(s) with provided bone name
- Added API to lock model against modifications during evaluation (required for non-racing off-GT evaluation)

Animation Sequence
- Frame-rate is now stored on a per-platform basis, allowing for future replacement of frame-stripping (editing property is disabled for now)
- Now allows for storing _transient_ per-platform compressed animation data (required for multi-platform cook)

PerPlatformProperties
- Added per-platform FFrameRate implementation

#preflight 63999f102540a78d2778adb7
#rb Thomas.Sarkanen, Nicholas.Frechette, Devin.Doucette
#fyi Zousar.Shaker

[CL 23510521 by Jurre deBaare in ue5-main branch]
2022-12-14 05:56:08 -05:00
Robb Surridge
610c467639 Update vendor links for built-in plugins to use secure protocol.
#jira UE-166823
#rb lauren.barnes
#preflight 6352b20b7261e565c476ec3b

[CL 22690089 by Robb Surridge in ue5-main branch]
2022-10-21 11:04:07 -04:00
jose villarroel
b78ae011f5 -Added blueprint function for custom animation modifiers to find stop/moving ranges
-Fixed stop detection in orientation warping modifier
#jira none
[REVIEW] [at]Aaron.Cox, [at]Fernando.Coello
#rnx
#preflight 6335b3c7936ff7e3dcb59811

[CL 22262825 by jose villarroel in ue5-main branch]
2022-09-29 23:45:10 -04:00
bryan sefcik
50d4fac9e0 Updated ../Engine/Plugins/... to inline gen.cpp files
Before:
3548 unity files
Total CPU Time: 47343.578125 s
Total time in Parallel executor: 494.60 seconds

After:
3445 unity files
Total CPU Time: 46044.671875 s
Total time in Parallel executor: 468.51 seconds

#jira
#preflight 63336159b20e73a098b7f24f

[CL 22218213 by bryan sefcik in ue5-main branch]
2022-09-28 01:06:15 -04:00
jose villarroel
3e18c3d714 Fix for build error on deprecated FAnimContext use
#jira none
#rb trivial
#preflight skip

[CL 22150171 by jose villarroel in ue5-main branch]
2022-09-22 20:38:31 -04:00
jessica agee
fc45781f36 Exposed useful functionality from MotionExtractor to allow blueprints to make their own modifiers
[REVIEW] [at]Fernando.Coello, [at]Aaron.Cox
#jira none
#preflight 632caa3f10030508067611b4

[CL 22148303 by jessica agee in ue5-main branch]
2022-09-22 18:57:04 -04:00
fernando coello
bd5839e9c8 CopyBoneAnimModifier: Validate intpus and fixed bug where a wrong bone transform was being set when modifying bones in the same chain
[REVIEW] [at]jose.villarroel [at]aaron.cox
#jira UE-164042
#preflight 63287eec1c7511917a9105bb

[CL 22086982 by fernando coello in ue5-main branch]
2022-09-19 21:56:09 -04:00
fernando coello
1712e285a3 Fix for CopyBonesModifier moving bones to incorrect locations when using world space transforms
[REVIEW] [at]jose.villarroel [at]aaron.cox
#jira UE-164033
#preflight 6324946e74361465146b7018
#9567

[CL 22054613 by fernando coello in ue5-main branch]
2022-09-16 13:56:35 -04:00
fernando coello
9b4f69c0d2 MotionExtractorModifier: Added option to get normalized values and option to get values relative to the first frame in the animation.
#review-21828715 @jose.villarroel @aaron.cox
#fyi @caleb.longmire
#jira none
#preflight 631fb8271d7d87945445f724

[CL 21982450 by fernando coello in ue5-main branch]
2022-09-13 10:28:54 -04:00
Jurre deBaare
ff0db16d0b Reintroducing AnimationDataModel refactor with additional memory and cooktime optimizations.
**Animation Data Model load/cook time and memory optimizations**
- Added SetKeysOnly to FMovieSceneFloatChannel, allowing to only set value/frames values and skip allocating key handles
- Added EvaluateWithCache to TMovieSceneCurveChannelImpl, allowing to evaluate multiple curves using a caching data structure holding the frame-indices resulting from the FrameTime -> indexes calculationg
- UFKControlRig::GetControlName/GetControlTargetName, added thread_local mapping cache and optimized FName generation
- Made the sequencer bone curve keys 'sparse' again, if constant it just sets the default value for the curve otherwise it is still uniform
- Only resample keys when compressing, and clear them on any significant model changes and when save-during-cook has been completed
- Routed ::Presave for AnimSequencerDataModel directly through to UMovieSceneSignedObject to skip compiling cooked sequencer that that will/should never cooked and packaged
- Added some significant pass-by-reference changes to AnimSequencerModel APIs (passing large arrays by value previously) :doh:
- Optimized GenerateLegacyBoneData

Original CL description:

**New**
- Engine
	- IAnimationDataModel interface
- AnimationData plugin
	- AnimSequencerDataModel, sequencer based implementation of IAnimationDataModel
	- AnimSequencerDataController, controller for above (implementation of IAnimationDataController)
- Added FCompressedRichCurve::PopulateCurve, allowing users to convert back to a FRichCurve for validation/debugging
- Added DefaultFrameRate to AnimationSettings, this replaces the hardcoded 30FPS in code
- Added ::GetKeyIndicesFromTime which takes FFrameRate
- Added AnimSequenceBase::OnAnimModelLoaded, this is required for correct postloading behaviour of data model (specifically AnimSequencerDataModel, as it depends on data from its outer ? anim sequence)
- Added IAnimationDataModel ::Evaluate which now takes responsibility for evaluating raw animation bone, curve and attribute data. And moved all trackbased evaluation code into AnimDataModel.cpp
- Added a.ForceEvalRawData allowing to force evaluation of source data
- Added a.SkipDDC to force compressing animation data locally

**Changed**
- Reparent UAnimDataModel to IAnimationDataModel interface, and rejig behaviour
- AnimSequenceBase now reference AnimDataModel as IAnimationDataModel
- Upgrade path for legacy to IAnimationDataModel and existing UAnimDataModel to IAnimationDataModel through IAnimationDataController::PopulateWithExisting
- IAnimationDataModel data is now frame(number/rate/time) based rather than seconds/keyindices. This enforces frameborder aligned data from now on.
- Moved RichCurve evaluation code from RichCurve.cpp to separate file and consolidated all instances of copy-pasta behaviour
- Updated/removed deprecated EngineTests around AnimSequences
- Changed many instances to use a FFrameTime together with a known FFrameRate versus seconds and sequencelength in float involving frame \/ time calculations (including instances of FAnimKeyHelper)
- Switched anim sequence evaluation to use double in Extraction context for time value and patched up places with static\_cast\<double\>
- FRichCurve::Eval
	- Make sure we always evaluate keys when T >= Key0.Time and T <= KeyN.Time to deal with crazy userweighted tangents
- Fixed WeightedKeyDataAdapter::GetKeyInterpMode/GetKeyTangentWeightMode retrieving invalid values, as it was indexing according to KeyIndex rather than KeyIndex\*2. This made it so that values were misinterpreted.
- Fixed WeightedEvalForTwoKeys for compressed data retrieving GetKeyInterpMode and GetKeyTangentWeightMode using the wrong index value. As they are not indexed using KeyDataHandle type.
- Fixed issue where compression could crash when containing zero-key scale additivebase track (tries to retrieve)
- Replaced instances of NULL with nullptr
- Moved required decompression information into FAnimSequenceDecompressionContext and reimplemented decompression within UE::Anim::Decompression namespace and new file
- Deprecated ::GetRawDataGuid and replaced with GetDataModel()->GenerateGuid()
- Fixed UAnimStreamable evaluation/compression (previously broken with MVC refactor)
- Updated Animation exporting pipeline to be frame-based rather than seconds
- Deprecated RetargetPose, replaced with FRetargetingScope (used within AnimModel::Evaluate)
- Fixed BaseAdditiveAnimation array become invalid/incorrect when removing zero-additve tracks during compression
- Updated EngineTest animation sequence related tests to new APIs (while maintaining deprecated path testing as well for now)
- AnimDataController / Animation Sequence tests now generate a USkeleton for the transient animation sequence (used to perform the test on)

**Removed**
- Unused file/class AnimData/AnimDataNotifyCollector.h

#rb Thomas.Sarkanen, Mike.Zyracki
#jira UE-131296
#preflight 631f6897a9331c69c3a34d1e

[CL 21980597 by Jurre deBaare in ue5-main branch]
2022-09-13 06:41:15 -04:00
fernando coello
0cc19fd94e AnimModifier to copy transforms from one bone to another
#review-21419088 @jose.villarroel @aaron.cox
#fyi @paddy.walker @caleb.longmire
#jira none
#preflight 63053a5e5a5d4e46243147c0

[CL 21520431 by fernando coello in ue5-main branch]
2022-08-23 17:07:54 -04:00
fernando coello
358b0dbfe1 Fixed bug where the modifier could end up modifying the wrong bone when applied on an animation using a compatible skeleton with a different hierarchy than the original.
#review-21355865 @jose.villarroel @aaron.cox
#fyi @paddy.walker
#jira UE-157604
#preflight 62f66fe9185b21882a904d25

[CL 21356057 by fernando coello in ue5-main branch]
2022-08-12 11:32:02 -04:00
fernando coello
f51444055f AnimationModifierLibrary: Added animation modifier to reorient the root bone in the animation while maintaining mesh position and rotation
#review-20813995 @aaron.cox @jose.villarroel @jurre.debaare
#jira UE-157604
#preflight 62bcc385963115ab3e71217d

[CL 20883988 by fernando coello in ue5-main branch]
2022-06-29 17:45:56 -04:00
Marc Audy
de2c3cb8e0 [Backout] - CL20593017, 20594056, 20625634, 20645670, 20649179, 20649223, 20649380, 20658535
Add new custom version to specify a certain window of AnimSequences are not loadable
#fyi Jurre.deBaare
#robomerge EngineMerge
Original CL Desc
-----------------------------------------------------------------
**New**
- Engine
	- IAnimationDataModel interface
- AnimationData plugin
	- AnimSequencerDataModel, sequencer based implementation of IAnimationDataModel
	- AnimSequencerDataController, controller for above (implementation of IAnimationDataController)
- Added FCompressedRichCurve::PopulateCurve, allowing users to convert back to a FRichCurve for validation/debugging
- Added DefaultFrameRate to AnimationSettings, this replaces the hardcoded 30FPS in code
- Added ::GetKeyIndicesFromTime which takes FFrameRate
- Added AnimSequenceBase::OnAnimModelLoaded, this is required for correct postloading behaviour of data model (specifically AnimSequencerDataModel, as it depends on data from its outer ? anim sequence)
- Added IAnimationDataModel ::Evaluate which now takes responsibility for evaluating raw animation bone, curve and attribute data. And moved all trackbased evaluation code into AnimDataModel.cpp
- Added a.ForceEvalRawData allowing to force evaluation of source data
- Added a.SkipDDC to force compressing animation data locally

**Changed**
- Reparent UAnimDataModel to IAnimationDataModel interface, and rejig behaviour
- AnimSequenceBase now reference AnimDataModel as IAnimationDataModel
- Upgrade path for legacy to IAnimationDataModel and existing UAnimDataModel to IAnimationDataModel through IAnimationDataController::PopulateWithExisting
- IAnimationDataModel data is now frame(number/rate/time) based rather than seconds/keyindices. This enforces frameborder aligned data from now on.
- Moved RichCurve evaluation code from RichCurve.cpp to separate file and consolidated all instances of copy-pasta behaviour
- Updated/removed deprecated EngineTests around AnimSequences
- Changed many instances to use a FFrameTime together with a known FFrameRate versus seconds and sequencelength in float involving frame \/ time calculations (including instances of FAnimKeyHelper)
- Switched anim sequence evaluation to use double in Extraction context for time value and patched up places with static\_cast\<double\>
- FRichCurve::Eval
	- Make sure we always evaluate keys when T >= Key0.Time and T <= KeyN.Time to deal with crazy userweighted tangents
- Fixed WeightedKeyDataAdapter::GetKeyInterpMode/GetKeyTangentWeightMode retrieving invalid values, as it was indexing according to KeyIndex rather than KeyIndex\*2. This made it so that values were misinterpreted.
- Fixed WeightedEvalForTwoKeys for compressed data retrieving GetKeyInterpMode and GetKeyTangentWeightMode using the wrong index value. As they are not indexed using KeyDataHandle type.
- Fixed issue where compression could crash when containing zero-key scale additivebase track (tries to retrieve)
- Replaced instances of NULL with nullptr
- Moved required decompression information into FAnimSequenceDecompressionContext and reimplemented decompression within UE::Anim::Decompression namespace and new file
- Deprecated ::GetRawDataGuid and replaced with GetDataModel()->GenerateGuid()
- Fixed UAnimStreamable evaluation/compression (previously broken with MVC refactor)
- Updated Animation exporting pipeline to be frame-based rather than seconds
- Deprecated RetargetPose, replaced with FRetargetingScope (used within AnimModel::Evaluate)
- Fixed BaseAdditiveAnimation array become invalid/incorrect when removing zero-additve tracks during compression
- Updated EngineTest animation sequence related tests to new APIs (while maintaining deprecated path testing as well for now)
- AnimDataController / Animation Sequence tests now generate a USkeleton for the transient animation sequence (used to perform the test on)

**Removed**
- Unused file/class AnimData/AnimDataNotifyCollector.h

#rb Thomas.Sarkanen, Martin.Wilson, Alexis.Matte, Mike.Zyracki
#jira UE-131296
#preflight 62a308a8b0150a87f9d6891b

[CL 20677979 by Marc Audy in ue5-main branch]
2022-06-15 18:24:46 -04:00