I am currently working on an update to our custom USD resolver and am running into issues in Houdini.
My current resolver looks like this:
Resolve:
The resolver gets its bound Resolver Context in the _Resolve method and passes the identifier / asset_path to the context to get the mapping.
Each resolver context can have what I would call sub contexts which it first checks if the identifier is handled inside.
If a sub context handles it, the mapped path is returned back to the _Resolve method. (with some extra steps since the mappings are stored in a different class inside a shared pointer).
Identifier:
If a new asset_path is encountered the bound resolver context also generates a corresponding identifier to it unique to itself so other context have different identifiers even for the same layer.
Inside Houdini we have a shot node and asset nodes to load and resolve the same.
The asset nodes all work with their own specific asset resolver context in the background (not applied to the actual Houdini stage) which are then on cook or when requested added to the main shot context as a sub context. This is to allow resolving the two separately and only merge them when needed.
Now when I want to trigger a refresh of the resolver after a mapping change what I did at first was trigger a ArNotice::ResolverChanged(*this).Send() signal and then pressed reload on the appropriate sublayer or reference lop nodes. This seemed to work perfectly at first however I recently stumbled over an issue with it.
It caused Houdini to either recook indefinitely or cook for an unnecessary amount of time if a geometry spreadsheet (or any panel that was accessing the stage) was open at the time of the signal and reload while that panel was pointing to a lower node that was an asset for example. So basically I resolved a shot node and below was an asset node which the geometry spreadsheet was pointing to.
I've removed the ResolverChanged signal for now but now reload layers doesn't seem to update the viewport the same as with it active.
The viewport needs to be reset every time a new asset is resolved.
So my question is this: What is the proper way to reload / refresh a usd resolver context. Should it work the way I am doing it and something is wrong with my implementation or is it the wrong approach

Any help/info or sanity check is much appreciated!!
Felix Poerner
Houdini Pipeline GhostVFX