Please remove ALevelSequenceActor dependency from FLevelSequencePlaybackContext

We would like to create custom actors that are not derived from ALevelSequenceActor but still represent a location where a level sequence may be played back (the runtime logic for the playback is custom for our use case). It makes sense to derive such a class from IMovieScenePlaybackClient, but the only way to preview the level sequence in the editor in the correct location is for the actor to be an ALevelSequenceActor, due to what I believe to be an unnecessary dependency on ALevelSequenceActor in FLevelSequencePlaybackContext.

As far as I can tell, the only specific use of ALevelSequenceActor in FLevelSequencePlaybackContext is the call to GetSequence in UE::MovieScene::FindLevelSequenceActors. In my opinion this call could be replaced with a call to an editor-only virtual function on IMovieScenePlaybackClient like `bool CanPreview(ULevelSequence*)`. That way, any implementer of IMovieScenePlaybackClient could make itself available in the list of preview contexts for a level sequence in the editor. ALevelSequenceActor would simply implement this function using the existing logic (`GetSequence() == InLevelSequence`). The `ALevelSequence` references in FLevelSequencePlaybackContext could then all be replaced with `AActor` references to allow for more extensibility.

I can provide a modified version of the current code if necessary, but the changes would span a few different files.

[Attachment Removed]

Hey there,

We don’t see any issues as well. Is this something that you can try converting it to AActor and submit a PR for?

Dustin

[Attachment Removed]

You can follow this documentation:

https://dev.epicgames.com/documentation/en-us/unreal-engine/contributing-to-the-unreal-engine

We review all changes to ensure API maintanence is maintained, sometimes changing code to better fit API changes or offer deprecation paths when necessary. For this change, we agree that it shouldn’t be an issue, but would like to know if it works in your codebase first.

Dustin

[Attachment Removed]

And just to add to the understanding here is there a reason you’re not using the transform origin actor for your previews?

https://dev.epicgames.com/documentation/en-us/unreal-engine/creating-level-sequences-with-dynamic-transforms-in-unreal-engine

Dustin

[Attachment Removed]

Hey there,

We attempted to compile your PR and ran into a compile error that needs to be addressed. For us, this is a bit of a lower priority, so if you address it, it is more likely to make it in sooner.

~\Engine\Plugins\MovieScene\LevelSequenceEditor\Source\LevelSequenceEditor\Private\Misc\LevelSequencePlaybackContext.cpp(390,101): error C2220: the following warning is treated as an error
		const FString ClientName = ClientActor ? ClientActor->GetActorNameOrLabel() : GetNameSafe(Client->_getUObject());
		                                                                                                  ^
~\Engine\Plugins\MovieScene\LevelSequenceEditor\Source\LevelSequenceEditor\Private\Misc\LevelSequencePlaybackContext.cpp(390,101): warning C4996: 'IMovieScenePlaybackClient::_getUObject': Do not call _getUObject(), use Cast.

[Attachment Removed]

Looks good, and it was submitted in mainline p4 at CL:51240286. There was a deprecation made to keep things ok with backwards compatibility.

Dustin

[Attachment Removed]

Sure! Is there some documentation on the correct way to do that? I haven’t submitted a PR before.

Also, I have a question about best practices: My proposed change would involve changing the return type of FLevelSequencePlaybackContext::GetPlaybackClient (from ALevelSequenceActor* to AActor*), which is a publicly exposed function. This technically would be a breaking API change if dependent code is using that function, but it doesn’t seem to be used in engine code. What is the standard practice for changes like that?

[Attachment Removed]

Thanks! It works in our codebase. Here is my pull request: https://github.com/EpicGames/UnrealEngine/pull/14434

[Attachment Removed]

In the specific workflow I’m trying to support, there is no ALevelSequenceActor placed in the world that references the level sequence. Instead, we have a custom actor that controls level sequence playback in a custom way (and acts as the origin as well). So there is no way to set a transform origin actor in the traditional way because there is no ALevelSequenceActor associated with the level sequence at all. However, after the changes I’ve proposed, our custom actor would implement IMovieScenePlaybackClient, override GetInstanceData, and control the origin through that after being selected as the playback context.

[Attachment Removed]

Thanks for letting me know. I guess my compile didn’t treat warnings as errors. I’ve updated the PR

[Attachment Removed]

Awesome, thanks!

[Attachment Removed]