Hi folks, I have a question about best practices for managing generated/derived assets in UE. I have some cases in a project where I want to generate a runtime asset for use in-game, based on a source asset that’s configured in editor.
As a simplified example let’s say I have a data asset that is simple for a designer to configure, but I want to use that asset to generate an asset that’s optimized for use by game code. The source asset is needed by this build process but isn’t used by the game itself and therefore doesn’t need to ship (so no hard references etc.).
Is there a standard practice for handling this kind of situation, like custom build or cook steps? I could make an editor utility that builds the derived assets but what I really want is a process that runs automatically when playing in PIE or building standalone.
Update: I’m exploring an idea whereby one asset has a soft reference to another, and updates its derived data automatically whenever the referenced asset is updated/saved.
In order to achieve this, I need a way for one object to detect when an asset has changed in the Editor (e.g. by the package being saved) so that it can update its own data and then mark itself dirty.
Is there an easy way to achieve this? I can’t handle it in the deriving object’s constructor or PostEditProperty because the reference it holds isn’t changing, it’s a change in the object being referenced itself.
Ideally I would like to find a pattern that allows me to do this without having to modify the referenced object’s code, so that I can use it with built-in Unreal types without having to change engine code.
Not sure if it’s the best approach, but I’ve found that you can handle events like this by creating a child class of UAssetManager and setting it as your Asset Manager class in Project Manager.