I wanted to ask about updating nested asset paths. I initially thought this was up to an Asset Resolver to help pick and update at resolve time, but after having a discussion Today with some people I’m not so sure anymore.
Example
Consider this particular case for a versioned pipeline, so each output generates a new unique version. There’s not a hero/master/latest version file that gets replaced, but a new version published each time. It’s a pull pipeline where anyone picks when to update what they’ve loaded.
I create an asset with a model and a look.
asset.usd
- look.usd
- model.usd
Each of these is versioned.
- So modeling pushes v001, then v002, then v003.
- Same for the look department, pushes their v001, v002, v003, v004, etc.
asset_v006.usd
- look_v002.usd
- model_v003.usd
Now the layout or animation department are bringing this asset v006 into a shot.
All of these are also versioned - I’ve just omitted version numbers for readability
shot.usd
- layout.usd
- references: asset_v006.usd
The lighting department works on the lighting for the shot downstream:
shot.usd
- lighting.usd
- layout.usd
- references: asset_v006.usd
Now the asset’s model or look gets updated so we might be seeing updates to the version of the asset, e.g. an asset_v007.usd
or higher. I would expect the lighting department to be able to say “update the asset version” without having to go to the layout department and update it there to override its authored reference opinion.
shot.usd
- lighting.usd
- update the asset reference to latest, e.g. asset_v007.usd
- layout.usd
- references: asset_v006.usd
I’d say this ‘concept’ of replacing the path in this example refers to references but what I’m looking to do is to actually also support it for payloads and sublayers. I just want to say “update” a nested version that was loaded elsewhere.
The same issue also occurs with e.g. nested referencing of an asset into an assembly which gets loaded into a layout into a shot, etc. Say the “lamp” asset on the “cabinet” assembly is loaded into the layout and the lighting department wants to update the version of the lamp. How do they do that? (It’s essentially the exact same question, just more nesting.)
Question
The question now is “What are the options to update this nested reference’s asset path?” and preferably with some thinking about why or why not to use a specific case. What is the recommended workflow?
So how to update and pick which asset version I want - without having to load a newer version in layout and then updating my loaded shot with the new layout. Basically avoiding the “recursive” / “nested” rebuilding.
Thoughts
Asset Resolver Remapping
I initially thought this was up to a USD Asset Resolver. In Lighting department the resolver context would say ‘remap asset_v006 → asset_v007’.
Pros:
- It’s “non-destructive”.
Cons:
- Not sure if you can write this resolver context in a way from the lighting department so that it’s clear that the lighting department ‘updated’ this particular path.
- Not very explicity maybe from the perspective of the USD data itself.
- You’d likely remap a particular path to a new path (without context of which Prim you’re operating on?) and thus if the asset was referenced more than once, you can’t really set the version for only ONE of the references. You’d always be remapping all?
Deleting references, prepending new
We could also delete the existing reference, and prepend a new one. For example:
over "ModelA" (
delete references = @./ModelPublish/ModelA-v001.usd@</AssetA>
prepend references = @./ModelPublish/ModelA-v002.usd@</AssetA>
)
Pros:
- The layer’s authored opinion clearly show an explicit removal of the original.
Cons:
- You can’t really “replace” the original reference. If the original reference you’re replacing is say not at the front of the reference list or at the end you can’t really “insert” the replacement at the same index - and thus, you are either adding the replacement at a different strength than the original. Giving unintended results.
- If at some point the
shot.usd
file updates the reference to a newerlayout.usd
file which does not haveModelA-v001.usd
anymore, but a newer version. Then the “replacement” logic will not delete the original (it does not exist anymore) and you’ll now suddenly have two references to the model since you prepended a new one, but also didn’t remove the one from layout.
Explicit reference list
The lighting department authors an explicit list override to the references
Pros:
- You can replace the path at the correct index, preserving the strength ordering.
Cons:
- Quite destructive in the fact that you’re authoring way more changes than just updating the one asset path. You’re basically redefining all references completely.
- You’re completely overriding all upstream behavior of the references, but also even downstream if those only prepended/appended since (I believe) explicit opinion is stronger.
Side notes
Preferably there’s a way to do this in a mostly DCC agnostic manner. E.g. explicit override lists in Houdini in lighting might make more sense than in Maya, because Houdini Solaris is more procedural in nature and ‘updating to latest’ behavior might be more stable to do to only swap a single path because when reopening the lighting scene it could just re-run that python LOP node, but in Maya we might need very different logic to update any remapping.
Of course, lots of focus could also be spent on whenever a new model is published that all downstream uses are automatically updated and new versions published - however the recursive updates can easily grow to tons of uses.
In short, I have a feeling I might be ‘missing’ a core USD concept here on how to do this - or there’s just no reasonable recommendation to give for this workflow.