65 Commits

Author SHA1 Message Date
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
nick darnell
3e81121a50 AssetDefinition - "UV Editor" plugin's option no longer hides if it won't work (determining it requires loading the assets), so it's just going to determine that when you fire it and fire a notification if it wont work.
AssetDefinition - Skeleton
AssetDefinition - SkeletonMesh
AssetDefinition - StringTable

#jira UE-165574

[CL 23658411 by nick darnell in ue5-main branch]
2023-01-11 20:52:36 -05:00
Thomas Sarkanen
d9c2b172f7 Skeleton compatibility improvements
Skeleton compatibility is now bi-directional. Specifying a compatible skeleton A -> B now implies B -> A.
Skeleton compatibility is now an editor-only concern. The runtime will attempt to do the 'best it can' via name -> name mappings. Only the editor will prevent assigning incompatible skeletons in (e.g.) asset pickers etc.
Skeleton compatibility checks in editor can now be disabled in the editor preferences (and each asset picker now has a checkbox option in its view settings that allows for quick access to this).

Moves FSkeletonRemapping to its own file (which is now private).
Skeleton remappings are now generated on demand on worker threads just before animation decompression and stored in a registry, guarded by FRWScopeLock for thread-safety.

Fixed some anim BP compiler edge cases where asset references on pins were not getting preloaded correctly, causing skeletons to be erroneously reported as missing.

Exposed the current asset registry filter in SAssetView so that menu extensions can access it (and use it to provide context)

#jira UE-166054
#jira UE-167355
#rb Jurre.deBaare,John.vanderBerg
#preflight 635902602e6690262afa86f9

[CL 22878911 by Thomas Sarkanen in ue5-main branch]
2022-11-01 06:25:59 -04:00
alexis matte
fe35eb697a Interchange:
- Skeletal mesh is now import using the skeletalmesh compile system to make sure all properties are locked and will stall another thread trying to access them.
---- This fix multiple crash if a viewer display the skeletal mesh and use some properties.
- Remove animation pipeline ensure(no skeleton) if we import with force static mesh and there is some translated animation node
- Fix crash when importing static mesh and the get mesh payload return an empty mesh description
- Reimport of skeletalmesh is not calling anymore postedit change if we reimport with interchange, interchange will call it in a post edit step.
---- This fix multiple crash if a viewer display the bones of the re-import skeletal mesh.
General:
- Reimport handler now have a reimport async version so the caller can control if a reimport is done asynchronously or synchronously

#jira UE-166986
#rb danny.couture , jeanluc.corenthin
#rnx
#lockdown jeanmichel.dignard
#preflight 634f61fdec03b54e9cdfe0bf

[CL 22634973 by alexis matte in ue5-main branch]
2022-10-19 15:15:54 -04:00
eric knapik
ebeb6781c1 Animation BP toolbar trimming & permissions
* Tab filters are now applied before tab widgets before are created for animation blueprint editor instead of only when a user tries opening a new tab. This prevents disallowed tabs in default layouts being created.
* Event graph documents are not opened if event graph permissions are disabled when loading blueprint editor.
* Added new blueprint permission to optionally disable function overrides.

#rb thomas.sarkanen
#preflight 6346928ef04e6f8505f7b879

[CL 22547860 by eric knapik in ue5-main branch]
2022-10-15 02:13:23 -04:00
lucas dower
a5b975ca24 Fix for Persona mesh details text overlay blocking hit tests
* Fix for Persona mesh sections showing as selectable when not.
* Fix for editor viewport cursor style not updating if using orbit camera mode.

#jira UE-157811
#rb thomas.sarkanen
#preflight 63246538ea1c94f4c5b3dfc7

[CL 22052213 by lucas dower in ue5-main branch]
2022-09-16 12:44:00 -04:00
kiaran ritchie
9ece7682e8 Adding "Preview Scene Settings" tabs to IK Rig & Retarget editors.
This change also added a delegate to FPersonaToolkitArgs with reference to a IDetailBuilderLayout so assets can customize the Preview Scene Settings.

#JIRA https://jira.it.epicgames.com/browse/UE-148894
#rb halfdan.ingvarsson
#preflight
#preflight 631b7a00967ffc68fb262e06

[CL 21924418 by kiaran ritchie in ue5-main branch]
2022-09-09 13:58:03 -04:00
Jurre deBaare
1b6de89585 Allow adding curves to edit in anim sequences
#feature now have the ability to edit multiple curves simultaneously inside of the Animation Editor by adding/removing curves of interest
#jira UE-151505
#rb Thomas.Sarkanen
#preflight 6315e8e97562a90dfaa00ea0

[CL 21791291 by Jurre deBaare in ue5-main branch]
2022-09-05 08:31:57 -04:00
bryan sefcik
0837230669 Ran IWYU again on half of the Engine/Source/Editor/... source files.
#jira

[CL 21716414 by bryan sefcik in ue5-main branch]
2022-08-30 23:03:03 -04:00
kriss gossart
0422ca7705 Skeletal Mesh - Replace the newly created GetSkeletalMesh function by GetSkeletalMeshAsset so it matches the setter SetSkeletalMeshAsset function (which itself couldn't be named SetSkeletalMesh due to the function already existing and doing something else).
#rb Josie.Yang
#preflight 62fa2afeae3edb54c979492e
#jira none

[CL 21385959 by kriss gossart in ue5-main branch]
2022-08-15 09:26:50 -04:00
thomas sarkanen
0afd4dccb7 Fixed crash cancelling an animation export
Popup for the animation recorder allowed access to temporary/invalid objects that were due to be garbage collected
Switched MPK/GC of discarded assets to just rename to the transient package on cancellation
Added optional parameter to not display the 'animation recorded' popup as this is an internal asset creation

#rb Lucas.Dower
#preflight 62c82e64f671e8d2face2ba9

#ROBOMERGE-AUTHOR: thomas.sarkanen
#ROBOMERGE-SOURCE: CL 21007451 via CL 21007477 via CL 21007484 via CL 21007499
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21019084 by thomas sarkanen in ue5-main branch]
2022-07-08 23:14:55 -04:00
Josie Yang
6b15506e58 Replace direct access to SkeletalMesh object from USkinnedMeshComponent with GetSkeletalMesh function
#rb kriss.gossart
#preflight 62aafc9ada0af39a4783930a

[CL 20686007 by Josie Yang in ue5-main branch]
2022-06-16 09:14:04 -04:00
Lauren Barnes
6248f8d412 Replacing legacy EditorStyle calls with AppStyle
#preflight 6272a74d2f6d177be3c6fdda
#rb Matt.Kuhlenschmidt

#ROBOMERGE-OWNER: Lauren.Barnes
#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
#ROBOMERGE-CONFLICT from-shelf

[CL 20105363 by Lauren Barnes in ue5-main branch]
2022-05-09 13:12:28 -04:00
Matt Peters
7ad238a806 AssetRegistry includes (Engine/Source): change #include "AssetData.h" -> #include "AssetRegistry/AssetData.h", and similar for the other moved AssetRegistry headers.
#rb Zousar.Shaker
#rnx
#preflight 6270509a220f89f0ad573030

[CL 20016982 by Matt Peters in ue5-main branch]
2022-05-02 18:06:48 -04:00
thomas sarkanen
3f8fa9692b Converted a number of animation editor menus & toolbars to use tool menus
Also applied asset permissions to various UI sections

#rb Jurre.deBaare,Sara.Schvartzman
#preflight 6267d7dd272f4a558dbcdb6a

#ROBOMERGE-OWNER: thomas.sarkanen
#ROBOMERGE-AUTHOR: thomas.sarkanen
#ROBOMERGE-SOURCE: CL 19918869 via CL 19921093 via CL 19923159 via CL 19923181
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19926251 by thomas sarkanen in ue5-main branch]
2022-04-26 15:03:55 -04:00
jurre debaare
b8c3f5335c Montage segment changes:
- Deprecated public access to AnimReference
    * Used for new behaviour that keeps track of PlayLength from referenced asset
    * In case the cached PlayLength does not match the current _and_ the cache playlength == than the segment length it can be deemed out-of-date due to a reimport
    * Out-of-date segments show in the OrangeAccent on the timeline rather than GreenAccent
    * Out-of-date segments will introduce log warnings on-load
- Patched up all paths using AnimReference (get/set)
- Modernized parts of EditorAnim* files
- Face-lifted details customization for AnimSegment
    * Scrollboxes now have (dynamic) UI/Clamp according to the context
    * Added behaviour for interactive operation when dragging the timeline (dragable) bars
- Implemented FAnimModel_AnimMontage::OnDataModelChanged to handle curve changes only - as play length etc is handled by montage editor itself

#rb Thomas.Sarkanen
#preflight 620fb4c9be45100d32bcc000

#ROBOMERGE-OWNER: jurre.debaare
#ROBOMERGE-AUTHOR: jurre.debaare
#ROBOMERGE-SOURCE: CL 19051190 via CL 19051207 via CL 19051231 via CL 19051241 via CL 19058489
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v918-19018356)

[CL 19066040 by jurre debaare in ue5-main branch]
2022-02-21 01:10:52 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
aurel cordonnier
a6e741e007 Merge from Release-Engine-Staging @ 17915896 to Release-Engine-Test
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-25 20:05:28 -04:00
lauren barnes
5d91d71f5c Removing Copy to SoundWave menu option as it is a workflow both Audio and Animation teams want to move away from
#jira UE-116859
#rb trivial
[FYI] Aaron.McLeran, Thomas.Sarkanen
#preflight 60d0c8aa2ab218000122f652

#ROBOMERGE-SOURCE: CL 16731206 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16731221 by lauren barnes in ue5-release-engine-test branch]
2021-06-21 14:38:30 -04:00
jurre debaare
349e585908 - Introduces UInterface for UAnimDataController and moves implementation to new AnimationDataController (editor only) module
- Export curve types entirely for use outside of Engine
- Miscellaneous small fixes from UE5 Main
#rb Thomas.Sarkanen
#preflight 6061973e25b98e00019ea154

#ROBOMERGE-OWNER: jurre.debaare
#ROBOMERGE-AUTHOR: jurre.debaare
#ROBOMERGE-SOURCE: CL 15849140 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15851594 by jurre debaare in ue5-main branch]
2021-03-29 11:34:31 -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
john vanderburg
bf43ab59e4 Make sure the asset browser window stays active when double clicking an anim montage.
Before this fix it would change focus to the Montage Sections tab/window, which kills the workflow when trying to browse between different montages as you had to switch back to the asset browser tab all the time after double clicking.

Now the workflow is non-disruptive.

#Jira UE-100972
#review-14485219 @Aaron.Cox, @Thomas.Sarkanen
#fyi Laurent.Delayen

[CL 14524644 by john vanderburg in ue5-main branch]
2020-10-20 12:55:45 -04:00
Jurre deBaare
e46208d52b Tool menu API extension for Persona editor umbrella - exposing partial PersonalToolkit API to scripting through context uobject
#jira UEA-674
#rb Thomas.Sarkanen

[CL 14492424 by Jurre deBaare in ue5-main branch]
2020-10-14 12:00:06 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00