Download

How to create cubemaps during runtime (in editor and in pie and normal game)

I’m trying to do a system that captures multiple cubemap textures and I’m using the following way to do it:




//in header
UPROPERTY(Transient, VisibleAnywhere, BlueprintReadOnly, Category="TOD|Misc")
TMap<int32, UTextureCube*> skycubemaps;


//in cpp
FString name = World->GetName() + (TEXT("sky_cubemap_alt#")) + FString::FromInt(i);
UTextureCube* cube = cubeTarget->ConstructTextureCube(this, name, EObjectFlags::RF_NoFlags);
if (cube)
{
    skycubemaps.Add(i, cube);  
}


This works somewhat, but it doesn’t allow me to save the map due to some reference/pointer issue that I can’t wrap my head around. Below is the message I get.


Can't save ../../../../../Unreal Projects/Proto/Saved/Autosaves/Game/Maps/T/SkyDomeRendering_Auto1.umap: Graph is linked to private object(s) in an external package.
External Object(s):
AssetImportData
  
Try to find the chain of references to that object (may take some time)?

Any tips?

Edit: This was actually caused by my UTextureRenderTargetCube* and USceneCaptureComponentCube* UPROPERTIES not being Transient.