(Auto) asset import breaks after opening an asynchronously loaded level
We have encountered a problem where asset importing stopped working in certain situations. This happens with both automatic and manual reimporting.
It can be reproduced was as follows:
A debug session showed that the SourceData variable in UAssetImportData for the broken assets wasn't set. This value is supposed to be set in the UAssetImportData::Serialize function. However, this function is not always being called.
Some more investigation showed that the reason Serialize is not called is that the RF_NeedLoad flag is is not set on the UAssetImportData object.
It was observed that the AssetImportData was loaded properly when it was used in a small level. The reason for the different behaviour is a branch in FLinkerLoad::CreateExport. Somewhere in the middle of the function there is the following piece of code:
Here we see a branch that is entered when AsyncLoading is enabled. In this branch the RF_NeedLoad flag is only being set under certain conditions:
At this point the only flag set on the UAssetImportData object is RF_Async.
In UTexture::PostInitProperties it can indeed be observed that the UAssetImportData is constructed without any flags.
At this point I am not sure how to properly solve the problem. I am pretty certain the RF_NeedLoad flag needs to be set on the UAssetImportData objects somehow. But I don't understand the system well enough to decide how that should be achieved.
So, my question would be if someone is familiar with this system and can help me fix it, tell me if I'm looking in the right direction, or is this maybe a known issue that is already being worked on?
Hi Mr.Dean -
Thank You for your help, I was able to reproduce the issue and entered the report as UE-24505. As we continue to investigate a solution I will keep you informed here.
answered Dec 15 '15 at 03:40 PM
Lovecraft_K ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here