MovieRenderGraph cannot be duplicated in Game builds

Hey,

We are using MoviePipline with a MovieRenderGraph which works fine in Edtior builds but in Gamebuilds we get tons of ensures and the Variables in the graph are not set.

Edit: Happens also in UE5.7

Any idea how to fix this ?

=== Handled ensure: ===
Ensure condition failed: !Obj->HasAnyFlags(RF_NeedLoad|RF_WasLoaded) [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 3553] 
Replacing a loaded public object is not supported with cooked data: MovieGraphPin /Engine/Transient.MGC_LayerIsolation_Duplicate:DefaultOutputNode.MovieGraphPin_0 (Flags=0x42ded8a0, InternalObjectFlags=0x00280040)
Stack: 
[Callstack] 0x00007ff739d464f0 AVE_Application-Win64-DebugGame.exe!`ProcessScriptFunction<void (__cdecl*)(UObject * __ptr64,FFrame & __ptr64,void * __ptr64)>'::`37'::<lambda_3>::operator()() []
[Callstack] 0x00007ff72d717329 AVE_Application-Win64-DebugGame.exe!StaticAllocateObject() []
[Callstack] 0x00007ff72d7182b2 AVE_Application-Win64-DebugGame.exe!StaticConstructObject_Internal() []
[Callstack] 0x00007ff72d3541d5 AVE_Application-Win64-DebugGame.exe!FDuplicateDataWriter::GetDuplicatedObject() []
[Callstack] 0x00007ff72d3449a8 AVE_Application-Win64-DebugGame.exe!FDuplicateDataWriter::operator<<() []
[Callstack] 0x00007ff72d626508 AVE_Application-Win64-DebugGame.exe!FObjectProperty::SerializeItem() []
[Callstack] 0x00007ff72d5d8907 AVE_Application-Win64-DebugGame.exe!FArrayProperty::SerializeItem() []
[Callstack] 0x00007ff72d36f12b AVE_Application-Win64-DebugGame.exe!SerializeUnversionedProperties() []
[Callstack] 0x00007ff72d3c8cfa AVE_Application-Win64-DebugGame.exe!UStruct::SerializeTaggedProperties() []
[Callstack] 0x00007ff72d57c8c4 AVE_Application-Win64-DebugGame.exe!UObject::SerializeScriptProperties() []
[Callstack] 0x00007ff72d57bd9b AVE_Application-Win64-DebugGame.exe!UObject::Serialize() []
[Callstack] 0x00007ff72d57bbf0 AVE_Application-Win64-DebugGame.exe!UObject::Serialize() []
[Callstack] 0x00007ff72d719437 AVE_Application-Win64-DebugGame.exe!StaticDuplicateObjectEx() []
[Callstack] 0x00007ff73509ae91 AVE_Application-Win64-DebugGame.exe!UMovieGraphPipeline::DuplicateConfigRecursive() []
[Callstack] 0x00007ff73509b1ea AVE_Application-Win64-DebugGame.exe!UMovieGraphPipeline::DuplicateConfigRecursive() []
[Callstack] 0x00007ff73509b5d7 AVE_Application-Win64-DebugGame.exe!UMovieGraphPipeline::DuplicateJobAndConfiguration() []
[Callstack] 0x00007ff7350a5e7a AVE_Application-Win64-DebugGame.exe!UMovieGraphPipeline::Initialize() []
[Callstack] 0x00007ff735141aad AVE_Application-Win64-DebugGame.exe!UMoviePipelineInProcessExecutor::OnMapLoadFinished() []
[Callstack] 0x00007ff735158fb5 AVE_Application-Win64-DebugGame.exe!UMoviePipelineInProcessExecutor::Start() []
[Callstack] 0x00007ff73515bb88 AVE_Application-Win64-DebugGame.exe!UMoviePipelineLinearExecutorBase::StartPipelineByIndex() []
[Callstack] 0x00007ff735141d72 AVE_Application-Win64-DebugGame.exe!UMoviePipelineInProcessExecutor::OnMoviePipelineFinished() []
[Callstack] 0x00007ff73512f158 AVE_Application-Win64-DebugGame.exe!TBaseUObjectMethodDelegateInstance<0,UMoviePipelineInProcessExecutor,void __cdecl(FMoviePipelineOutputData),FDefaultDelegateUserPolicy>::ExecuteIfSafe() []
[Callstack] 0x00007ff735081c2e AVE_Application-Win64-DebugGame.exe!TMulticastDelegateBase<FDefaultDelegateUserPolicy>::Broadcast<IBaseDelegateInstance<void __cdecl(FMoviePipelineOutputData),FDefaultDelegateUserPolicy>,FMoviePipelineOutputData>() []
[Callstack] 0x00007ff7350a9e71 AVE_Application-Win64-DebugGame.exe!UMovieGraphPipeline::OnMoviePipelineFinishedImpl() []
[Callstack] 0x00007ff7350bcb83 AVE_Application-Win64-DebugGame.exe!UMovieGraphPipeline::TransitionToState() []
[Callstack] 0x00007ff7350b9fc8 AVE_Application-Win64-DebugGame.exe!UMovieGraphPipeline::TickPostFinalizeExport() []
[Callstack] 0x00007ff7350a9917 AVE_Application-Win64-DebugGame.exe!UMovieGraphPipeline::OnEngineTickBeginFrame() []
...

[Attachment Removed]

Hey Dominic,

I checked in with the dev, and this should be technically supported, but it’s probably not been very tested. Are you all running a custom build, or is this all the released precompiled binary?

[Attachment Removed]

Are you duplicating before the render and feeding that to MRG? Can you provide a little more detail there?

I ran this past the dev and he said “If their own pipelining code is duplicating before the render, then I could see this causing an issue 100%… doing that in a game would be dicey. However, MRG’s own duplication would likely not be problematic. So if they’re doing the duplication themselves, I’d advise them to look into alternative solutions and ask why they need to duplicate.”

Either way he’s gonna look into it but has higher priorities with 5.8 hardlock, to be totally transparent. So it might take a bit.

[Attachment Removed]

Hey Dominic,

Thanks for this. I JIRA’d this internally, and the dev will have a look once he gets through some priorities. Thanks for your patience!

[Attachment Removed]

So I now got the Reproducer for the Copy ensure postet initially in this Ticket. It happens as soon as you queue two jobs using the same Movie Render Graph Config, see the attached reproducer.

Best

Dominic

[Attachment Removed]

Got it, added to the ticket. Thanks!

[Attachment Removed]

Hey Dominic,

I was able to get the JIRA public facing so you can follow along if you like.

https://issues.unrealengine.com/issue/UE\-381126

[Attachment Removed]

Hey,

we using the launcher version and actually not doing anything special here just queuing a job with a movie render graph. I can try to make a reproducer project.

Best

Dominic

[Attachment Removed]

Hi [mention removed]​,

So actually i could not reproduce the Copy error in a blank project but actually the code does more or less the same, I will look further into it.

But this also showed that my original issue was not coming from that Ensure in the first place.

If you look into the Reproducer Project you can see that in Editor builds the variables of a Movie Render Graph Config can be set correctly via C++ but this does not work in Game Builds. I am also not able to step into UMovieJobVariableAssignmentContainer::SetValueString() to see whats going on there.

Edit: It is the same issue with UE 5.7

I will have a look into our project what is triggering the Ensure in the meanwhile.

Best

Dominic

[Attachment Removed]

Reupload of the reproducer

[Attachment Removed]