When running in the editor my UMediaTexture is properly executing InitializeTrack. However when I go to cook, I get the following crash…
UE4Editor-MediaAssets.dll!UMediaTexture::InitializeTrack() Line 252 C++
UE4Editor-CoreUObject.dll!UObject::ConditionalPostLoad() Line 723 C++
UE4Editor-CoreUObject.dll!EndLoad() Line 1285 C++
UE4Editor-CoreUObject.dll!LoadPackageInternal(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags=0, FLinkerLoad * ImportLinker) Line 1041 C++
UE4Editor-UnrealEd.dll!UCookOnTheFlyServer::TickCookOnTheSide(const float TimeSlice=10.0000000, unsigned int & CookedPackageCount=4) Line 1670 C++
UE4Editor-UnrealEd.dll!UCookCommandlet::NewCook(const TArray<ITargetPlatform *,FDefaultAllocator> & Platforms, TArray<FString,FDefaultAllocator> & FilesInPath={…}) Line 1218 C++
UE4Editor-UnrealEd.dll!UCookCommandlet::Main(const FString & CmdLineParams) Line 561 C++
UE4Editor.exe!FEngineLoop::PreInit(const wchar_t * CmdLine=0x0000000002961000) Line 1639 C++
UE4Editor.exe!GuardedMain(const wchar_t * CmdLine=0x00000000005d4538, HINSTANCE__ * hInInstance=0x00000000005d448e, HINSTANCE__ * hPrevInstance=0x000000000000000a, int nCmdShow=1069809664) Line 110 C++
UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance=0x000000013fc40000, HINSTANCE__ * hPrevInstance=0x0000000000000000, char * __formal=0x0000000000000000, int nCmdShow=10) Line 189 C++
UE4Editor.exe!__tmainCRTStartup() Line 618 C
kernel32.dll!0000000076d45a4d() Unknown
ntdll.dll!0000000076e7b831() Unknown
Specifically at…
VideoTrackPtr->AddBoundTexture((Resource->TextureRHI.GetReference()));
… because Resource is null. The previous call to UpdateResource is not initializing Resource because UTexture::UpdateResource is checking against FApp::CanEverRender which is returning false during the cook process.
How do I resolve?
Thanks,