Commit Graph

117 Commits

Author SHA1 Message Date
david bromberg
71e3da8dc8 Sequencer: Major integration of Universal Object Locators into Sequencer. This includes:
* Adding some first pass UI for editing the Universal Object Locators that are used to bind objects to tracks in Sequencer. This is currently in the form of:
   * An 'Add Empty Binding' item in the + Actor to Sequencer menu
   * A 'Binding Properties' sub-menu in the object binding track properties that allows you to modify the array of UOL's that bind objects to the track. This allows you to specifically select certain UOL types and then fill in the data that makes up that UOL. This is necessary for example for the FortAIPlayerPawn    binding we plan on adding for UEFN.
* Major refactor of MovieScene binding code to more seamlessly allow for the use of the Locator resolution, especially in the case of supporting locators that spawn actors, either in the case of editor preview actors or future runtime 'spawnables'. This was necessary to consolidate the cases where locator resolve params were being created to as few places as possible for simplicity.
* Add the concept of 'default' editor and runtime flags to locators to make it easier for Sequencer to know how to interact with bindings of different types. These flags are then stored with the binding in Sequencer and editable by users as necessary. Sequencer treats 'load'/'unload' in this case similar to 'spawn'/'despawn' and generally speaking resolving a locator with editor flags of 'load' will expect the locator to spawn an actor for preview, while resolving a locator with runtime flags of 'load' will expect the locator to create a 'spawnable' character.
* To manage lifetime of these preview/spawnable characters, created an interface for a 'LocatorSpawnedCache' which the locators interact with when creating or destroying an actor. This allows the resolver of locators to differentiate between cases where they expect multiple resolves of the same locator to create duplicate actors vs. resolve to the same actor and track the lifetimes of these spawned actors.
* Sequencer implements the above cache within its own object cache in evaluation state.
* Expand the role of the previously created Binding Lifetime track to trigger loading/unloading via locators in the cache. The Binding Lifetime track will now automatically be added to a binding if its locator type contains 'Load' as a default editor or runtime flag.
* Some other editor updates to support the above.

Future issues to be resolved:
* We want to more easily expose the editing of binding properties when necessary rather than having it buried in a sub-menu. Ideas for this include some kind of UI on the track itself, for example a combo box with binding types on it, as well as potentially the properties menu appearing on hovering over the possessable icon on the object binding track. We also want to expose properties based on selection, for example object binding properties, track properties, and section properties, in another external window.
* We want to eventually replace the 'Actor to Sequencer' and 'Assign Actor' menu with this once the UX is better.

The above was all tested with a Fortnite NPC Locator type which will be added in a separate changelist.

[REVIEW] [at]ue-sequencer
#jira UE-199299

[CL 30596833 by david bromberg in ue5-main branch]
2024-01-12 12:41:00 -05:00
ludovic chabant
1cea568259 Sequencer: initialize playback capabilities in InitRootSequenceInstance
#rb Andrew.Rodham
#jira UE-196728

[CL 30359009 by ludovic chabant in ue5-main branch]
2023-12-15 15:42:25 -05:00
andrew rodham
389412f945 Sequencer: Convert default binding mechanism to use universal object locators
Level Sequences now use UOLs for their bindings.
Level Sequence player context is now an ALevelSequenceActor if possible.
All bindings (including the extreme-legacy lazy object ptr bindings) are now upgraded to use the UOL binding mechanism.

Introduced a new concept for reasoning about object hierarchies in Sequencer: object schemas. Schemas allow customization of how Sequencer handles finding 'parent' and 'child' objects, which allows us to genericize lots of the hard-coded Actor-Component logic. This is just a first pass - there are still many places that directly deal with AActor and UActorComponent, which will be gradually migrated with upcoming work.

#jira UE-199305
#rb david.bromberg, ludovic.chabant

[CL 29932924 by andrew rodham in ue5-main branch]
2023-11-27 09:05:23 -05:00
ludovic chabant
c2bfe4b3e9 Sequencer: move more IMovieScenePlayer features into playback capabilities
This is the third step in the overall refactor to remove the dependency of Sequencer evaluation code on IMovieScenePlayer. It puts most of the spawnables/possessables logic into playback capabilities, so that systems concerned with them can find them there instead of depending on the player interface. In order to do this, many APIs previously taking a player pointer now take a shared playback state reference, which is where they find the playback capabilities.

To keep the changelist to a manageable size, we don't deprecate the previous APIs right away except where we don't have much choice, such as the virtual methods of the spawn register. Everywhere else, passing a player is still a valid call.

Some other APIs have also changed, because the shared playback state structure often gives all the information someone may ever need, and this renders many parameters obsolete. This is for instance the case with sequence updaters.

One aspect of this change that needs to be carefully handled is the initialization and re-initialization of a sequence hierarchy prior to playback. Now that evaluation code relies on playback capabilities, these capabilities need to be added to the sequence hierarchy's shared playback state in a timely manner, and they need to react to changes in the hierarchy. The following changes have therefore been made:

- Playback capabilities can implement callbacks for initialization and for when a new sub-sequence instance is added.
- Sequence instances have a new Initialize method that needs to be called shortly after creation. This is especially needed for root instances, as it gives time for the caller to setup their playback capabilities before finishing the initialization.

Another aspect of this change is that it unearthed a problem with the capability storage, where we could stomp memory and crash while relocating capabilities to make room for a new one. This happened if we did not reallocate a new buffer (i.e. relocating in place). Moving headers could stomp the space of the first couple capabilities before we had a chance to move them. The code now moves things from back to front, first the capabilities, and second the headers.

Finally, this change adds the ability to overwrite a capability with a new value. This is needed for the way the level sequence player initializes itself (see the comment in the code).

The following things have been made into playback capabilities, or have had a new capability interface created around them:

- FMovieSceneEvaluationState, for access into object caches.
- IMovieScenePlaybackClient, for dynamic binding overrides.
- The player index, for retrieving the player interface, if any (mostly for legacy evaluators).
- Notification callbacks for when object bindings change.
- Static binding overrides.
- Storage and management of sequence director blueprints.

Since the player interface is now an optional playback capability, some progress has been made to gracefully handle the case of no such player existing.

#jira UE-199669
#jira UE-199668
#rb Andrew.Rodham

[CL 29895537 by ludovic chabant in ue5-main branch]
2023-11-22 15:18:16 -05:00
max chen
de6b800de0 Sequencer: Mark SequencePlayer as deprecated for 5.4. It can be accessed through GetSequencePlayer()
#jira UE-197922
#rb andrew.rodham
#noqatesting
#lockdown aaron.dittmann, scott.lindeneau, corey.novich, dan.nottingham

[CL 28973413 by max chen in ue5-main branch]
2023-10-20 14:10:22 -04:00
ludovic chabant
1af1bee2b1 Sequencer: don't add a playback capability if it already exists
This can happen if a level sequence is re-initialized with a sequence that it was already set to.

#rb max.chen

[CL 28141287 by ludovic chabant in ue5-main branch]
2023-09-22 12:43:40 -04:00
ludovic chabant
2814fcabe7 Sequencer: use pre-animated state API in camera cut track instance, and remove directly use of player API
This change tries to address various problems with the camera cut evaluation logic:

- Use the pre-animated state API to properly handle restoring things, instead of doing it partially "by hand". This removes the need for a few hacks like the carry-over of previous view-targets from one sequence to the next.

- Move the code from FSequencer and ULevelSequencePlayer into the track instance (and some related helper classes). Not only does this remove a bit of code duplication, this also lets us take a first step towards removing the dependency of evaluation code on the player API.

#rb max.chen
#jira UE-194692

[CL 28093600 by ludovic chabant in ue5-main branch]
2023-09-21 13:26:39 -04:00
max chen
15dc1334bd Sequencer: Make sure setting the last view target is done even in early out. This fixes an issue where if sequence 1 plays and cuts to camera 1, and the sequence 2 plays and also cuts to camera 2, it restores properly when the sequences finish playing.
#rb ludovic.chabant

[CL 27118544 by max chen in ue5-main branch]
2023-08-15 16:20:45 -04:00
patrick enfedaque
6188379211 LevelSequence: Fix LevelInstance actor resolving of AlwaysLoaded LevelInstance actors and Disabled Streaming World Partitions
#rb richard.malo
#rnx

[CL 26615274 by patrick enfedaque in ue5-main branch]
2023-07-26 14:13:45 -04:00
ludovic chabant
d21bb511c2 Sequencer: fix static analysis warnings
#rb max.chen

[CL 26609771 by ludovic chabant in ue5-main branch]
2023-07-26 12:00:39 -04:00
ludovic chabant
95adb6370b Sequencer: fix camera cut flag not being set when spawnable cameras are the last in control
This was because calling GetViewTarget does some internal checks. If a spawnable camera has just been unspawned (i.e. the actor is PendingKill) then this trips those checks and the view target is reset to the pawn before we can even do anything. Because we are restoring the view target to the pawn, this is registered as "not changing anything" and we skip everything in UpdateCameraCut, including setting the camera cut flag.

We therefore don't use GetViewTarget, and grab the view target directly from the public member to manage things by hand.

#jira UE-190045
#rb max.chen

[CL 26550161 by ludovic chabant in ue5-main branch]
2023-07-24 14:05:34 -04:00
ludovic chabant
f815208aa5 Sequencer: correctly reset the last known serial number when handling replays.
This was causing all replay messages to be ignored for being too old.

#rb nickolas.drake

[CL 26481536 by ludovic chabant in ue5-main branch]
2023-07-20 07:28:13 -04:00
ludovic chabant
0b39d4c528 Sequencer: carry over the previous view target from a previously playing level sequence, if any
#rb max.chen

[CL 26193855 by ludovic chabant in ue5-main branch]
2023-06-22 16:59:54 -04:00
patrick enfedaque
0e5b4e3fc0 LevelSequence: Support Level Sequences within World Partition embedded Level Instances
#jira UE-180753
#rb richard.malo, andrew.rodham
#preflight 644fad875875c7d4b4c0b3bf
#rnx
#tests LevelSequence test group + multitude of WP Level Instance use cases (regular WP and instanced)

[CL 25284484 by patrick enfedaque in ue5-main branch]
2023-05-01 11:30:16 -04:00
patrick enfedaque
f420077d88 LevelSequence: Replace single StreamedLevelAssetPath param by a new struct pointing to StreamedLevelAssetPath (Ground work for new resolve path)
#jira UE-180753
#rb andrew.rodham
#preflight 644bd2faf50260822902edd5
#rnx

[CL 25240419 by patrick enfedaque in ue5-main branch]
2023-04-28 16:43:32 -04:00
ludovic chabant
5f0c4c6215 Sequencer: restore aspect ratio axis constraint directly on the player if the level has changed during sequence playback
#udn 00420602
#preflight 643736954c0cdaea09734410
#rb max.chen

[CL 25069277 by ludovic chabant in ue5-main branch]
2023-04-17 12:13:30 -04:00
alexis beracochea
82375d370a Keep level sequence player up to date with view target changes during playback, so that it restores the last known desired view target when stopping
[CODEREVIEW] [at]ludovic.chabant

#localization none
#tests PIE

[CL 24500561 by alexis beracochea in ue5-main branch]
2023-03-03 12:02:28 -05:00
ludovic chabant
fb68ac56d7 Sequencer: take play-rate into account for blend times between blending camera cuts
#preflight 63fecb41ef1b24bf9457c600
#rb max.chen
#jira none

[CL 24467835 by ludovic chabant in ue5-main branch]
2023-03-01 14:22:53 -05:00
jamie dale
e48d6a02f7 Fix LevelSequence resolving on Instanced WorldPartition cells
#rb andrew.rodham, jeanfrancois.dube, richard.malo
#rnx
#preflight 6392001a67018b14b5843c5b

[CL 23460249 by jamie dale in ue5-main branch]
2022-12-08 21:23:22 -05:00
henrik karlsson
fa90b399a4 Added includes for future change. This changelist only contains added #include and a couple of empty placeholder files
Tested compiling fortnite, unrealeditor, lyra, qagame with non-unity/pch

#preflight 63635997876630122adeab9f
#rb none

[CL 22958990 by henrik karlsson in ue5-main branch]
2022-11-03 14:18:47 -04:00
henrik karlsson
b5b86c796c This change is a strategical submit for a coming change that removes lots of includes in headers that are included by many files. This change contains adding of includes in files that previously got those includes transitively from other inclkudes
#preflight 6355d4940313c24974b2107b
#rb none

[CL 22783162 by henrik karlsson in ue5-main branch]
2022-10-26 12:57:32 -04:00
Max Chen
f57db3e0fa Sequencer: Remove Master from Sequencer
- Remove all instances of Master from the UI - ie. Replace Create Master Sequence with Create Sequence with Shots
- Internally, remove Master - Master Tracks in the MovieScene can just be Tracks

Deprecations (Properties):
- UMovieScene:MasterTracks deprecated for Tracks
- UMovieSceneFolder:ChildMasterTracks deprecated for ChildTracks
- FLevelSequencePlayerSnapshot: MasterName, MasterTime for RootName, RootTime
- UMoviePipelineSetting_BlueprintBase: bIsValidOnMaster for bIsValidOnPrimary

Deprecations (Functions):
- UMovieScene: GetMasterTracks, FindMasterTracksByType, FindMasterTracksByExactType, AddMasterTrack, RemoveMasterTrack deprecated for GetTracks, FindTracksByType, FindTracksByExactType, AddTrack, RemoveTrack
- UMovieSceneFolder: GetChildMasterTracks, AddChildMasterTrack, RemoveChildMasterTrack deprecated for GetChildTracks, AddChildTracks, RemoveChildTrack
- FMovieSceneTrackEditor: FFindOrCreateMasterTrackResult, FindOrCreateMasterTrack deprecated for FindOrCreateRootTrackResult, FindOrCreateRootTrack
- ULevelSequenceDirector: GetMasterSequenceTime deprecated for ULevelSequenceDirector::GetRootSequenceTime
- UDaySequenceDirector: GetMasterSequenceTime deprecated for UDaySequenceDirector::GetRootSequenceTime
- UMoviePipelineSetting: IsValidOnMaster for IsValidOnPrimary
- UMoviePipelineBlueprintLibrary: GetMasterTimecode, GetMasterFrameNumber for GetRootTimecode, GetRootFrameNumber
- UMoviePipeline: GetPipelineMasterConfig for GetPipelinePrimaryConfig
- UMovieSceneAudioTrack: IsAMasterTrack

Classes Renamed:
- FAnimTypePreAnimatedStateMasterStorage for FAnimTypePreAnimatedStateRootStorage
- UMovieSceneMasterInstantiatorSystem for UMovieSceneRootInstantiatorSystem
- ULevelSequenceMasterSequenceSettings to ULevelSequenceSequenceWithShotsSetting

Note, the following instances of master still occur and a "KnownCase" has been added for them in CheckAcceptableWords.cs:
- Deprecated properties (MasterTracks -> Tracks) and functions (ie. GetMasterTracks -> GetTracks)
- masterclip in FCPXML since it's an industry standard term
- masteraudiosubmix in AudioCaptureProtocol
- mastersubmix in MoviePipelineAudioRendering
- masteertimecode, masterframenumber, masterconfig, validonmaster in MovieRenderPipeline
- mastersequencetime, mastertime, mastername in LevelSequence

#jira UE-158660
#preflight 634645e48a0a7b2adc5722e7
#rb matt.hoffman, andrew.rodham

[CL 22739302 by Max Chen in ue5-main branch]
2022-10-24 18:22:10 -04:00
max chen
c5727585e9 Sequencer: Separate application of UMovieSceneSequencePlayer::PlaybackSettings from Initialize
Captain's log of the reason behind why this is required:

When spawning a replicated Level Sequence Actor on the server, a SequencePlayer subobject is also created and replicated along with it. If the sequence player is interacted with directly (by way of calling things like PlayLooping, which adjust the loop count of the player's playback settings directly), there can be a justifiable discrepancy in playback settings on the server between the actor and its player. This is not a problem in practice because the Actor's playback settings are only used for initialization.

When these 2 objects are replicated to the client, the client receives the properties for both the actor and sequence player in the same network bunch, applies them, then calls PostNetReceive on both objects. Unfortunately it can call ALevelSequenceActor::PostNetReceive before UMovieSceneSequencePlayer::PostNetReceive, which means the Actor ends up calling Initialize on the player (because it hasn't been set up yet - it's only just been spawned by the net code), which ends up trampling over the player's PlaybackSettings that were just applied by the net replication.

Since the shadow state on the server thinks it has already sent those properties to the client, it never sends them again, so the client doesn't think it's looping when the server does.

#rb Ludovic.Chabant, Max.Chen
#preflight 63345955031c90cb0bab2afb

[CL 22240516 by max chen in ue5-main branch]
2022-09-28 22:24:01 -04:00
marc audy
311f7464bf Updated ../Engine/Source/Runtime/... to inline gen.cpp files
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]
2022-09-24 13:57:58 -04:00
bryan sefcik
07894f4a07 Removed redundant private include paths from build.cs files.
Fixed include paths to be relative to the private or public folders.
Hid or removed includes that reached into other private module folders.
Updated PublicInclude paths when necessary.

#jira
#preflight 631a717cec45fbf3d74d4ba7

[CL 21916033 by bryan sefcik in ue5-main branch]
2022-09-09 00:53:22 -04:00