I have a custom asset which is imported from a custom data type on disk. I’ve followed the pattern of StaticMesh, PaperSpriteSheet, etc. where I’m keeping an instanced UAssetImportData on the asset UObject, populated at Import/Reimport time with the timestamp and relative file path of the source data, serialized via standard UPROP reflection (with the PostInitProperties NewObject etc, just like the examples I mentioned).
Everything works perfectly when I’m working with template or empty levels: I’m able to import and create new assets, place them,reimport them, save and exit, reload and reimport – everything.
The problem appears when I load a large level that references these assets (whether as a command line argument or via EditorStartupMap): everything seems to load successfully, but when I go to reimport one of these referenced assets, reimport fails because the AssetImportData has not been Serialize’d. The asset definitely has the path data (I can see it in a hex editor), and again it can reimport just fine when I just startup into the template level.
I’ve put some breakpoints around the code in LinkerLoad and have verified that when my AssetImportData is being loaded in, it has RF_ASync* flags still on it but not the RF_NeedLoad flag. As such it skips the virtual Serialization completely.
I’ve tried to reproduce this behavior with large levels full of heavy StaticMesh objects, but the StaticMeshes always have a Serialize’d AssetImportData by the time PostLoad rolls around. Also I don’t have any DDC calls, I was thinking that might be masking a race condition for StaticMeshes that I’m seeing on my assets? I can’t see anything else I might be doing wrong to get the subobject loading correctly, can you offer anything to try ?
Thanks!