@spiff - Thank you for confirming.
This leads to my next question, which is can anyone offer guidance on how to solve the following?
We are writing discovery and parser plugins for MDL.
The NdrIdentifier’s that we create are done so by a function that is effectively a direct copy of the _GetIdentifierForAsset function in ndr/registry.cpp:
OpenUSD/pxr/usd/ndr/registry.cpp at release · PixarAnimationStudios/OpenUSD (github.com)
If we have detected that a MDL module has changed on disk we update the registry by creating new SDR nodes. The SDR metadata that we pass to the _GetIdentifierForAsset function contains a version field.
e.g.
So on first load the sdr metadata might look like
{“version”: 1}
and after a module has been reloaded:
{“version”: 2}
The problem with this approach is that anytime we want to call something like the following, the only way to ensure that the “correct” identifier (the one which points to the most recent version of the node in the registry) is used would be to ensure that the SDR metadata on the underlying prim is updated.
api = UsdShade.NodeDefAPI(prim)
sdr_node = api.GetShaderNodeForSourceType("mdl")
While this is doable what I think would help here would to have a way for a plugin to define how the NdrIdentifiers are created.
Perhaps something like adding a additional method, GetIdentifierForAsset, to the NdrParserPlugin.
The logic for the default implementation would be identical to _GetIdentifierForAsset , however developers could override it if need be.
Then inside of NdrRegistry::GetNodeFromAsset we could call the plugin implementation vs _GetIdentifierForAsset, e.g.
NdrIdentifier identifier =
parserIt->second->GetIdentifierForAsset(asset, metadata, subIdentifier, sourceType);
Does that seem reasonable? Or perhaps I am overlooking something and there is a better/existing way to handle something like this?