Commit Graph

405 Commits

Author SHA1 Message Date
timothy daoust
aab28b4589 Pausing animation sequences with a single frame
#jira UE-86940
#rb thomas.sarkanen

#ROBOMERGE-SOURCE: CL 15340963 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15340972 by timothy daoust in ue5-main branch]
2021-02-05 15:36:32 -04:00
timothy daoust
a6dbf3b021 Remove the ability to circumvent connection rules with reroute node in an animation blueprint.
#jira UE-79013
#rb thomas.sarkanen

#ROBOMERGE-SOURCE: CL 15340365 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15340532 by timothy daoust in ue5-main branch]
2021-02-05 15:07:02 -04:00
Thomas Sarkanen
6ebd594d49 Fixed crash opening a pose asset
The pose asset code path in the preview instance used to run its graph udpate in UpdateAnimation(), which meant that the regular scoped sync wasnt applied. Switching it to run in UpdateAnimationNode() means that everyting functions as normal.

#jira UE-107354 - Crash when attempting to open a pose asset
#rb jurre.debaare

[CL 15238297 by Thomas Sarkanen in ue5-main branch]
2021-01-28 10:55:26 -04:00
Zousar Shaker
3b4c8fc1c5 Automated wrapped object pointer upgrade for Engine + ShooterGame + ShooterGame referenced plugins
#rb none

[CL 15224650 by Zousar Shaker in ue5-main branch]
2021-01-27 17:40:25 -04:00
Thomas Sarkanen
79c9b00eea Misc BlendSpace 2.0 fixes
Fixed drag/drop of samples in blend space graphs.
Fixed issues around replacing samples and stale anim graph tabs when replacing/deleting samples.
Prevented sample point graph duplication from My Blueprint.
Preserved sync groups when converting from players to graphs.

#jira none
#rb Jurre.deBaare

[CL 15216418 by Thomas Sarkanen in ue5-main branch]
2021-01-27 07:24:02 -04:00
Thomas Sarkanen
2bc2ddff38 Non-unity/non-PCH CIS fixes
#rb trivial

[CL 15208782 by Thomas Sarkanen in ue5-main branch]
2021-01-26 12:41:42 -04:00
Thomas Sarkanen
2d2f89842b Fixed crash pasting a state machine
#jira none

[CL 15206339 by Thomas Sarkanen in ue5-main branch]
2021-01-26 08:36:03 -04:00
Thomas Sarkanen
5419497f90 BlendSpace 2.0: Blendspace Graph Node
Added a new animation graph node that hosts its own UBlendSpaceBase. Modified UBlendSpaceBase to allow for pose links to be evaluated as the sample points.
The new blend space graphs can be spawned from existing UBlendSpace and UBlendSpace1D assets, or they can be created from scratch, or they can be converted from existing blendspace player nodes via the context menu.

Fixed anim node conversion functions so that their transactions work correctly.

Updated FBlueprintEditorUtils::IsGraphNameUnique to allow it to work with any object as the outer, not just UBlueprint. UBlueprint still has a special case for functions and events. This is to support GenerateUniqueGraphName within a scope (e.g. an outer graph).

Formalized the concept of 'node sub-graphs' (as well as the composite node pattern a little). Previously a number of known node types that contained sub-graphs (e.g. UK2Node_Composite) had special case logic for dealing with node/graph deletion etc. Now  any node can opt into this behaviour via the GetSubGraphs() override.

Added status bar readouts for the blendspace grid, so we dont have to stuff the prompts into the tooltip any more.

Moved anim BP related APIs out of FBlueprintEditor. They are always used via FAnimationBlueprintEditor.

Refactored graph title bar widget creation out into a function to allow other document tab factories to create it.

Altered breadcrumb trail click callbacks and SMyBlueprint::ExecuteAction to always JumpToHyperLink rather than calling OpenDocument directly. This allows unknown (to FBlueprintEditor) document types that reference objects to be correctly jumped to using the breadcrumb trail. Derived asset editors (i.e. FAnimationBlueprintEditor) can intercept the JumpToHyperlink call to ensure that the correct document is presented (i.e. the correct tab payload is generated).

Instead of making yet another bunch of duplicated code for handling the various alpha blend options, refactored this into FAnimGraphNodeAlphaOptions (for editor code) and FAnimNodeAlphaOptions (for runtime code).

Added OnCopyTermDefaultsToDefaultObject for per-node copying of default values from editor node to runtime node, rather than another special-case in the compiler.

#rb Jurre.deBaare,Phillip.Kavan

[CL 15177316 by Thomas Sarkanen in ue5-main branch]
2021-01-25 08:43:19 -04:00
Jurre deBaare
f24003f082 Animation data MVC refactor
#jira UE-104234
#rb Thomas.Sarkanen, Martin.Wilson, Alexis.Matte, Michael.Zyracki

+ Introduced UAnimDataModel, this currently represents the source data for bone and curve animation. It contains:
    + Bone animation tracks (FBoneAnimationTrack)
        + Key data (coarse)
        + Name
        + Bone tree index
    + Curve data (FAnimationCurveData)
        + Float Curves
        + Transform Curves
    + Play length
    + Sampling rate
        + Used for deriving the expected number of keys/frames when combined with the PlayLength
    + Transient data for supporting backwards compatibility APIs
    + (Dynamic) delegate which broadcasts the mutation Notifies

+ Introduced UAnimDataController, this has sole authority over mutating data contained by UAnimDataModel
    + API functionality allows to transform the contained data in all ways currently expected in the engine.
        + Any mutation will add an undo/redo-able FChange object into the transaction buffer
            + FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
        + Broadcasts change notifies alongside a payload object containing details about the change
            + Interested systems/objects can register to these changes through UAnimDataModel::OnModelModified event
        + Almost all functionality is exposed to both Blueprint and Python scripting
    + Allows for opening 'Brackets', these define the beginning and end of a chain of mutations. Allowing anything registered to OnModelModified to halt responding to the notifies until the (top-level) bracket is closed
    + Undo/redo actions
        + Each mutation to the UAnimDataModel is covered by a 'Action' which is based of FChange and is used to insert a undo/redo-able operation into the transactions buffer

+ Introduced EAnimDataModelNotifType and per-notify payload types. These are used to update views, and any model derived data

+ Introduced FAnimationCurveIdentifier, exposed to scripting, this is used for referencing a curve by name and type when passed to the controller
    + Allows for targetting a specific RichCurve as part of a TransformCurve

+ Introduced FAnimationDataNotifyCollectorused for keeping track of which notifies of type EAnimDataModelNotifType are broadcasted between top-level EAnimDataModelNotifType::BracketOpened and EAnimDataModelNotifType::BracketClosed notifies

+ Added CanTransact to UEngine, returns whether or not a transaction can be made

+ Added UAnimCompositeBase::SetCompositeLength, used for runtime changing of play length value

+ Animation Sequence helpers, containing 'helper' functionality for both AnimSequence and AnimDataModel

* Animation Sequence Base
    + virtual PopulateModel, called during upgrade path for converting existing (legacy) data to the new UAnimDataModel data
    + virtual OnModelModified, registered to the Model's OnModified event to handle any Notifies and payloads
    + Added UAnimDataModel sub-object (editor only)
    + Added UAnimDataController instance (transient and editor only)
    + FAnimationDataNotifyCollector to keep track of model bracketed notifies
    * Deprecated
        * SetSequenceLength()
        * RefreshCurveData()
        * MarkRawDataAsModified()
        * RegisterOnAnimCurvesChanged()
        * UnregisterOnAnimCurvesChanged()
        * UnregisterOnAnimTrackCurvesChanged()
        * RegisterOnAnimTrackCurvesChanged()
        * Public access to RawCurveData

* Animation Sequence
    + Implements PopulateModel/OnModelModified for AnimationSequence related data
    + Added TargetFrameRate, currently locked to the initial sampling rate, but allows for resampling the UAnimDataModel data according to the set rate
    + Added NumberOfSampledKeys (editor only), populated by resampling process
    + Added NumberOfSampledFrames (editor only), populated by resampling process
    + Added ResampledAnimationTrackData (editor only and transient), populated by resampling process
    + Added bBlockCompressionRequests (editor only), used for blocking compression during automation tests
    * Deprecated
        * SetNumberOfSampledKeys()
        * MarkRawDataAsModified()
        * GetRawAnimationData()
        * GetAnimationTrackNames()
        * AddNewRawTrack()
        * GetRawTrackToSkeletonMapTable()
        * GetRawAnimationTrack()
        * GetRawAnimationTrack()
        * UpdateFrameRate()
        * ExtractBoneTransform()
        * CompressRawAnimData()
        * GetSkeletonIndexFromRawDataTrackIndex()
        * RecycleAnimSequence()
        * CleanAnimSequenceForImport()
        * CopyNotifies()
        * PostProcessSequence()
        * AddLoopingInterpolation()
        * RemoveAllTracks()
        * DoesContainTransformCurves()
        * InsertFramesToRawAnimData()
        * CropRawAnimData()
        * RemoveTrack()
        * InsertTrack()
        * ResizeSequence()
        * Non-editor access to GetUncompressedRawSize()
        * Non-editor access to GetApproxRawSize()
        * Public access to UpdateCompressedCurveName()
        * NumberOfKeys
        * SamplingFrameRate
        * TrackToSkeletonMapTable
        * RawAnimationData
        * AnimationTrackNames

* Animation Streamable
    * Model from source Sequence is duplicated rather than copying animation data

* Deprecated ERawCurveTrackTypes::RCT_Vector (marked as hidden)

+ Added automated test for
    + All script exposed controller functionality
    + Undo/redo actions
* Updated existing AnimSequence tests with deprecation and new expected data

+ Base data for compression is now populated from the 'resampled' version stored on the AnimSequence
+ Data cleanup and validation is now performed during compression
    + Track sanitization is now performed during compression (normalizing Quats and clamping near-zero values to zero)
    + Key reduction
    + Invalid track (missing bone from skeleton) removal
    + Curve name validation against skeleton
* Replaced RawCurves with Float curves
* Updated DDC key
- Removed all Guid generation related functionality (now part of the model)

* AnimSequenceBase model registers to AnimModel's notify event, used for refreshing the tracks
    * Replaces the in-place calling of RefreshTracks()
* All curve tracks now hold a const CurveType* rather than a CurveType*/& for introspection of its data
    + Any mutations now go through the controller API
    + Uses AnimationCurveIdentifier to set Transform's per-channel tracks
* RichCurveEditorModelNamed conformed to model/controller
    + Any modifications are applied to an temporary CurveType which always contains a copy of the const-ptr after any previous mutation
    + Registers to the outer AnimModel's notify event, used for updating the cached curve data
    + Registers to CurveModifiedDelegate, used for copying the temp curve data to the model using SetCurveKeys
        * Not-ideal but point that I got to for V1
        * Would be replaced with either refactoring FRichCurve to be MVC like, or by calling UAnimDataController functionality from an implementation of FRichCurveEditorModel

* Mark FChange overrides as final for swap/command change permutations
* Changed FCompoundChange GetDescription to return concatenation of all sub-changes
* Added GetDescription to FTransaction which returns the ToString() value of any contained FChange entries.
    * Entries in SUndoHistory tab now have a ToolTip showing the GetDescription() value
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo

* Deprecation handling, conforming code to new APIs and exposing structure/objects/properties to scripting
* Conforming AnimSequence importing from FBX to Model/Controller changes

[CL 15106211 by Jurre deBaare in ue5-main branch]
2021-01-15 06:41:11 -04:00
Thomas Sarkanen
a1047a0ab3 Fixed non-unity non-PCH compile errors
#jira UE-105396
#jira UE-105389
#rb trivial

[CL 15036308 by Thomas Sarkanen in ue5-main branch]
2021-01-11 07:54:28 -04:00
Thomas Sarkanen
13721df624 Removed ensure that could fire with old bits of anim graph left hanging around
#jira UE-105220
#rb Jurre.deBaare

[CL 15010625 by Thomas Sarkanen in ue5-main branch]
2021-01-07 12:00:35 -04:00
danny chapman
6139979106 Fix AnimBP transition warning if the rule is bound. Also auto-disconnect pins if they are to be replaced with a bound rule.
#jira UE-103558
#jira UE-105039
#rb thomas.sarkanen

[CL 15009206 by danny chapman in ue5-main branch]
2021-01-07 05:43:03 -04:00
Thomas Sarkanen
b85a3cea8c Animation sync node and anim graph attributes
Refactored tick record sync into utility structure - FAnimSync. This improves the odd API around tick records, better encapsulating functionality and leaving less for the caller to get wrong. This will also eventually allow this to be refactored out into a scriptable pipeline stage.
Added sync node and scoped sync message for new 'graph based sync'. Nodes that subscribe to graph-based-sync determine their sync group based on the scope that they are in.
Removed 4.26-style sync scopes - pushed all syncing up to the main anim instance. Linked anim instances no longer sync their own tick records.
To make graph based sync more useful, surfaced graph attributes and their visualizations as labels on pins and parallel wires to visualize flow.
This involves statically determining the attribute flow of the graph at compile time. Added a new compiler handler to deal with this new debug data.
Updated a lot of nodes to specify their attributes so graph flow can be correctly visualized.
Added tracing of attributes and sync records and visualization of traced records when debugging the anim graph.

#rb Jurre.deBaare, Martin.Wilson

[CL 14998555 by Thomas Sarkanen in ue5-main branch]
2021-01-06 09:11:59 -04:00
danny chapman
28ac3a409b Back out changes from 14974926 which cased blueprint compilation errors when the child anim blueprint intentionally had a different skeleton to the parent
#jira UE-105043

[CL 14993955 by danny chapman in ue5-main branch]
2021-01-05 15:16:55 -04:00
danny chapman
bf10c93d8c Addresses problem of being able to change the skeleton in a child animation blueprint by generating errors from the blueprint compilation helping the user fix things up
#jira UE-103860
#rb thomas.sarkanen

[CL 14974926 by danny chapman in ue5-main branch]
2021-01-04 09:29:10 -04:00
timothy daoust
3b3bf723c4 Pause the animation timeline for animation sequences with 1 frame
#jira UE-86940  (Pause or Lock AnimTimeline for Animation Sequences with only 1 frame when opened)

#rb thomas.sarkanen

[CL 14879724 by timothy daoust in ue5-main branch]
2020-12-08 12:53:04 -04:00
john vanderburg
e6bf65cb19 Add support for blend profiles inside anim montages and blend nodes.
Improved blend profile support adding a time based method.

#jira UE-100992
#review @Aaron.Cox, @Jose.Villarroel, @Thomas.Sarkanen

[CL 14831887 by john vanderburg in ue5-main branch]
2020-12-01 18:43:52 -04:00
halfdan ingvarsson
0e50cd24fe Relocating the contents of the Classes directory in AnimGraph in favor of Public.
#jira none
#trivial

[CL 14823295 by halfdan ingvarsson in ue5-main branch]
2020-11-30 16:40:07 -04:00
Lina Halper
963faf8b0d IKRig plugin first version
- you can add one type of solver - transform and then that will give you one goal and you can run it.
- 3 modules - IKRig, IKRigDeveloper, IKRigEditor
- IKRigDefinition is the main data for anim node.

#rb: Kiaran.Ritchie, Halfdan.Ingvarsson
#fyi: Kiaran.Ritchie

[CL 14814068 by Lina Halper in ue5-main branch]
2020-11-25 17:38:42 -04:00
Alexis Matte
73d83c6a38 To protect the skeletalmesh when using async operations like build or re-import we deprecate all public member variables of USkeletalMesh class and create the necessary getter and setter. Those member will stay public but will be move to private in a future release.
Adding a public member to USkeletalMesh class is now prohibed since it can break asynchronous operations that will be added next to this submit.

#rb danny.couture
#jira UEENT-3936
#rnx

[CL 14812920 by Alexis Matte in ue5-main branch]
2020-11-25 11:17:08 -04:00
Marc Audy
a7f9391231 Merge UE5/Release-Engine-Staging @ 14811410 to UE5/Main
This represents UE4/Main @ 14768117

For ReleaseObjectVersion.h
#lockdown Marcus.Wassmer

[CL 14811440 by Marc Audy in ue5-main branch]
2020-11-24 18:42:39 -04:00
jose villarroel
3b7d2ea62e -Added Blend Profile mode selection to blend profile picker.
-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]
2020-11-20 15:02:56 -04:00
braeden shosa
4bcf791d57 PoseSearch: Pose feature vector API, support for indexing and searching collections of animations, and lots of refactoring and cleanup.
+ Pose feature vector API
  + FPoseSearchFeatureVectorLayout
    - Explicit description of a pose feature vector (FV)
    - Determined by options set in a UPoseSearchSchema and owned by the schema. See UPoseSearchSchema::GenerateLayout().
  + FPoseSearchFeatureDesc
    - Describes each feature of a vector, including data type, sampling options, and buffer offset.
    - New data types introduced (previously only positions were supported)
    - Could potentially be extended in the future to support externally registered features, but that's not the goal for now.
  + FFeatureVectorBuilder
    - Helper object for writing features into a float buffer according to the layout
    - Keeps track of which features are present, allowing the FV to be constructed piecemeal
  + FFeatureVectorReader
    - Helper object for extracting features. Presently only used for debug rendering.
+ UPoseSearchDatabase
  - A data asset for indexing a collection of animation sequences
  - Support added for searching the collection and returning the matching sequence with time offset
+ Pose matching refactoring
  - Setup no longer requires an animation modifier or a special graph node
  + UPoseSearchSequenceMetaData
    - Replaces UPoseSearchIndexConfig and UPoseSearchIndex
    - Counterpart to UPoseSearchDatabase for a single animation instead of a collection
    - Simply add to sequence metadata, fill it out, and save
  + IPoseSearchProvider
    - Modular feature interface that replaces the need for AnimGraphNode_PoseMatchingSequencePlayer
    - The PoseSearch plugin now registers itself as an implementer of IPoseSearchProvider
    - AnimGraphNode_SequencePlayer now detects if a pose search provider exists and offers optional pose matching support
    - Currently exposed as checkbox in an "experimental" section of the node's settings
+ Other cleanup/refactoring
  + Namespacing
    - Pulled all non-UCLASS/USTRUCTs into a UE::PoseSearch namespace
    - Renamed PoseSearchDetail namespace to UE::PoseSearch::Private per standards
  + UPoseSearchSchema is no longer an animation asset
    - This was a kludge to get the bone reference UI to work
    - Now it's a data asset and implements IBoneReferenceSkeletonProvider
    - Removed related asset type actions and factory
  + FPoseSearchIndex replaces bits of UPoseSearchIndex
    - Has narrower scope and is shared by UPoseSearchSequenceMetaData and UPoseSearchDatabase
  + Odds n' ends
    - Removed FPoseSearchBuildQueryScratch. FPoseHistory now owns memory required for taking samples.
    - Debug drawing reworked in terms of FV API
    - Added a.PoseSearch.DrawSearchIndex console command to render the search index of any animation sequences currently open in the editor
    - Removed Blueprint function library for building search indices since animation modifiers are no longer needed
#rb Aaron.Cox

[CL 14615629 by braeden shosa in ue5-main branch]
2020-10-29 17:05:00 -04:00
Jurre deBaare
6f3438b57a UAnimSequence:
- Deprecated NumFrames instead added NumberOfKeys (data is copied over during serialization patch up)
- Deprecated GetNumberOfFrames and GetRawNumberOfFrames instead added GetNumberOfSampledKeys
- Deprecated SetRawNumberOfFrames and instead added SetNumberOfSampledKeys
- Added SamplingFrameRate (FFrameRate), which is populated according to the sequence's actual number of frames and length
- Changed some behaviour to use FFrameRate API to calculate frame number / timings
- Deprecated GetFrameRate and instead added GetSamplingFrameRate
- Fixed uses where NumFrames was assumed to contain the number of frames rather than the number of keys (ResizeSequence, AddLoopingInterpolation, CropAnimation, InsertKeysIntoRawData)

UAnimStreamable:
- Deprecated NumFrames instead added NumberOfKeys (data is copied over during serialization patch up)

ITimeManagementModule:
- Exposed GetCommonFrameRates through the abstract interface to get around circular Engine module dependency

#jira UE-102191
#rb Martin.Wilson

[CL 14608938 by Jurre deBaare in ue5-main branch]
2020-10-29 09:47:22 -04:00
Marc Audy
4c1bb11c29 Merge UE5/Release-Engine-Staging to UE5/Main @ 14548662
This represents UE4/Main @ 14525125 + cherrypicked fixes
#skipundocheck

[CL 14551026 by Marc Audy in ue5-main branch]
2020-10-22 19:19:16 -04:00