“Firstly, I’d like to say that ended up removing a lot of the log entries. Useful for understanding the system, but too verbose at the wrong times for something we’d actually deploy to developers/build systems.”
That is a sensible choice.
“There’s a crash waiting to happen in LexFromString, nullptr is passed in to ImportText for ErrorText and depending on what parser gets hit, on bad buffer data this can try to log a warning/error and hits a nullptr deref instead. I fixed this by passing in GLog which some other calls to ImportText do.”
Nice catch. I’ll make some notes from your feedback throughout these thread to update the article + example project.
“ApplyPrimaryAssetLabels can be called from other places side from ModifyCook, for example from UAssetManager::UpdateManagerDatabase. Is there any reason why the virtual ModifyCook itself didn’t get overridden? Or alternatively, at least only call the filtering logic in ApplyPrimaryAssetLabels during a cook?v”
ModifyCook() would have been a fine place to do it too. I believe one advantage from evaluating cook-rules in the editor is this:
- In release streams, we apply versioning in the editor. This includes Target.cs files to disable out-of-season plugins, and these AssetManager primary asset labels.
- This means that in the editor, when you right click a folder to Audit Assets, the Cook Rule column shows an accurate value.
It doesn’t provide benefit in development streams, if like us, you enable all plugins and all assets. But it’s useful for auditing in release streams.
“In ApplyPrimaryAssetLabels, “UE_LOG(LogTemp, Error, TEXT(” Asset ‘%s’ did NOT have a release version as asset tag!”), *AssetData.GetObjectPathString());" will be called for any asset that does not have a version range. I assume that is not actually desired?"
Up to you to decide. When I wrote that, I intended that you know exactly which primary asset types should and shouldn’t be versioned. Here I just chose for an ignored-types list ‘UnversionedPrimaryAssetTypes’ and assume that all other types are versioned by design. You can go the other way around, but I do think it’s valuable to define somewhere which types should have a version range and error if they don’t have the expected asset registry tags. Just in case someone introduces a subclass that overrides GetAssetRegistryTags() but forgets to call the Super:: implementation.
“This is more style, but I didn’t like having the separate `bHasSunsetVersion` property”
Sounds fine by me, whatever is developer friendly and not error prone. In the uplugin files I take it, that a missing SunsetVersion property is also interpreted as ‘never sunsets’?
[Attachment Removed]