Commit Graph

55 Commits

Author SHA1 Message Date
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
Louise Rasmussen
777a580c40 Bumping Persona Layout Versions
#fyi matt.kuhlenschmidt

[CL 14935406 by Louise Rasmussen in ue5-main branch]
2020-12-15 17:55:06 -04:00
Louise Rasmussen
431ed443be Persona Toolbars
#rb lauren.barnes

[CL 14932538 by Louise Rasmussen in ue5-main branch]
2020-12-15 13:36:10 -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
Jurre deBaare
62f0aa213f Momentum: Removing SourceAnimationData and doing animation layering bake during compression
#jira UEA-675
#rb Martin.Wilson

[CL 14298238 by Jurre deBaare in ue5-main branch]
2020-09-11 09:30:09 -04:00
brooke hubert
48113fc77e Adding EditorFramework to build.cs files
#rnx
#Jira UE-96448
#rb chris.gagnon

[CL 14114839 by brooke hubert in ue5-main branch]
2020-08-14 13:24:16 -04:00
brooke hubert
8f0c7f389f Persona based editors use asset editor toolkits to create and own their mode managers
#Jira UE-94282
#rb lauren.barnes

[CL 13812948 by brooke hubert in ue5-main branch]
2020-07-01 11:20:18 -04:00
jurre debaare
aa2893aa6c Revert previous change adressing UE-91227 which caused UE-91332, and fixed the crash rather than the UX issue instead
#jira UE-91227, UE-91332
#rb thomas.sarkanen
#lockdown James.Golding

#ROBOMERGE-SOURCE: CL 12529815 in //UE4/Release-4.25/... via CL 12529872 via CL 12529936
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v673-12478461)

[CL 12529997 by jurre debaare in Main branch]
2020-04-02 10:05:05 -04:00
jurre debaare
c471500592 Crash when closing the animation timeline document tab while editing curve
#fix ensure that the anim document tab can never be closed
#jira UE-91227
#rb Martin.Wilson
[FYI] Thomas.Sarkanen

#ROBOMERGE-SOURCE: CL 12472945 in //UE4/Release-4.25/... via CL 12472958 via CL 12472978
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v672-12450963)

[CL 12472987 by jurre debaare in Main branch]
2020-03-27 14:34:03 -04:00
Rex Hill
21041d4956 Fix deprecation warnings
#rnx
#rb none
#jira

[CL 11757070 by Rex Hill in Main branch]
2020-02-28 13:24:55 -05:00
Lina Halper
44c1bb3292 COPY from //Dev-Anim to //Dev-Main
#rb: none
#fyi: Laurent.Delayen, Thomas.Sarkanen

[CL 11088765 by Lina Halper in Main branch]
2020-01-22 17:58:55 -05:00
ryan durand
627baf970a Updating copyright for Engine Editor.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869241 via CL 10869527 via CL 10869904
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870586 by ryan durand in Main branch]
2019-12-26 15:33:43 -05:00
jurre debaare
159d18b188 Crash reimporting an animation
#fix close all editors when reimporting alembic skeleton asset, also make it so that in case the skeleton on the persona toolkit is null we do not refresh the editor
#jira UE-78345
#rb Thomas.Sarkanen

#ROBOMERGE-SOURCE: CL 9836503 in //UE4/Release-4.24/...
#ROBOMERGE-BOT: RELEASE (Release-4.24 -> Main) (v546-9757112)

[CL 9836584 by jurre debaare in Main branch]
2019-10-25 07:34:15 -04:00
Lina Halper
3fd7f76532 Copying //UE4/Dev-Anim to Dev-Main (//UE4/Dev-Main)
#fyi: Laurent.Delayn, Marc.Audy
#rb: none

[CL 9321182 by Lina Halper in Main branch]
2019-10-01 16:59:31 -04:00
Lina Halper
f7baa58bc9 Merging //UE4/Dev-Main to Dev-Anim (//UE4/Dev-Anim)
#fyi: Laurent.Delayen, James.Hopkin
#rb: none

[CL 4923303 by Lina Halper in Dev-Anim branch]
2019-02-06 14:35:56 -05:00
Chris Gagnon
a48e767b94 Merging //UE4/Dev-Main to Dev-Editor (//UE4/Dev-Editor)
#rb none

[CL 4835066 by Chris Gagnon in Dev-Editor branch]
2019-01-29 16:15:19 -05:00
Jurre deBaare
ebad4ba3ea //UE4/Dev-Anim - Incremental EngineTestEditor Mac - Action graph contains cycle!
#jira UE-68852
#rb Thomas.Sarkanen
#lockdown Thomas.Sarkanen

[CL 4783718 by Jurre deBaare in Dev-Anim branch]
2019-01-23 11:17:51 -05:00
Thomas Sarkanen
1520dd9a8b Moved asset creation tools to common Persona toolbar items
This means animations and pose assets can be created from (e.g.) skeletal meshes.

#jira UE-55400 - Always create animation section
#rb Jurre.deBaare

[CL 4769620 by Thomas Sarkanen in Dev-Anim branch]
2019-01-22 06:38:19 -05:00
Chris Gagnon
bd368fae31 Engine and Editor subsystems
- Dynamic subsystems for fixed module startup wrt subsystem initialization
- Python Gettter exposed for both eg: import_subsystem = unreal.get_editor_subsystem(unreal.ImportSubsystem)
- Import Subsystem with python exposed import events

#rb Matt.Kuhlenschmidt, Rex.Hill
#codereview Matt.Kuhlenschmidt, Rex.Hill

[CL 4725117 by Chris Gagnon in Dev-Editor branch]
2019-01-15 13:41:40 -05:00
Chris Gagnon
1a3bf5caf1 Merging The Engine directory from //UE4/Dev-Main to //UE4/Dev-Editor upto CL 4698813
#rb none

[CL 4720826 by Chris Gagnon in Dev-Editor branch]
2019-01-14 16:55:55 -05:00
Thomas Sarkanen
e0f6136524 Merging //UE4/Dev-Main to Dev-Anim (//UE4/Dev-Anim) @ CL 4704791
#rb none
#jiira none

[CL 4708070 by Thomas Sarkanen in Dev-Anim branch]
2019-01-11 04:11:30 -05:00
Chris Gagnon
8fc25ea18e Merging //UE4/Dev-Main to Dev-Editor (//UE4/Dev-Editor)
#rb none

[CL 4676797 by Chris Gagnon in Dev-Editor branch]
2019-01-02 14:54:39 -05:00