Reference Viewer behavior

“Which is presumably a caching optimization?”

It’s a very performant way of doing it, yes. Going through a big BP graph for example, collecting references, can take a little while which isn’t noticeable during save time. But when you start UE, it needs to scan every single asset in the whole project and collect those references to populate the asset registry. For thousands of assets, any amount of time that isn’t as close to “instant” as possible will quickly turn into death by thousand cuts. So it needs to be as fast as possible.

“Does that list include indirect referencers?”

No, it doesn’t, so that’s why I think this is so weird. I believe the MIC somehow got the reference to the Material function serialized into it during save time or at the time of creation, but that’s not supposed to happen.

“So maybe it was an issue of a stale cache of referencers being naively used by the reference viewer, where the direct referencer is gone so it was only a list of irrelevant references left?”

I think it was definitely an incorrect reference saved into the asset, which automatically “fixes itself” when you resave the asset since it uses now the more up-to-date, and presumably fixed, way of collecting references.

Glad to hear that resaving the asset fixes the problem and that it isn’t occurring for new assets! One final advice I have is to resave all the assets in the project any time the team does a UE version upgrade (like from 5.4 to 5.5, no need to do it for patches like from 5.5.0 to 5.5.4). We have a commandlet that does it for you, you can check out this community resource on the ResavePackages commandlet for reference.

The ResavePackages commandlet has a bunch of parameters you might want to look into, for example having it check the files into version control for you, skip checked-out assets, only resaving assets in certain folders, etc. You can check out `UResavePackagesCommandlet::Main` in UnrealEd\Private\Commandlets\ContentCommandlets.cpp for the parameters it accepts.