Resolving all file paths across a stage (dependencies)

Hi,

Does anyone have an example of how to collect a list of all the file paths (absolute ideally) across an entire USD stage which many sublayers, references, and payloads?

I’ve had a look around the internet but haven’t found much. We basically have an existing dependency scanning framework which relies on traversing node graphs like katana and nuke which in turn yields absolute paths in our asset management system if we are loading a shot composition with many sublayers, references etc we need to capture a set of incoming versions if possible.

Have you tried Universal Scene Description: pxr/usd/usdUtils/dependencies.h File Reference ?

Hey, well I will get my coat…thanks!

Sorry to resurrect an older question, but I had a similar question. If I have a stage open, is there a way to find all the dependencies N levels deep from the Root with their real paths and identifiers that could be modified by an asset resolver? Essentially I’m looking to find only the sublayers included 2 levels deep from the Root layer (I don’t want to traverse the whole thing) and test some of those identifiers to pass into a muteLayers.
Thanks!

Hi @Truant , unfortunately, we don’t provide any “composition-aware and parameterizable” dependency analysis. When you say “Essentially I’m looking to find only the sublayers included 2 levels deep from the Root layer” do you mean you want only the sublayers in the root layerstack that are nested inside top-level sublayers of the root layerStack. If so, you could manually walk them starting from the root layer.

We do that in usdview’s Common.GetRootLayerStackInfo() function.

Correct! I’d like to find the sublayers in the file I opened the Stage with, and then the sublayers of those. The way we’ve structured our USD’s that gets me the information I’m interested in and I don’t need to go any deeper and spend time processing. I saw that ComputeAllDependencies took a processing function but wasn’t sure if it would allow me pass a depth flag and stop after certain time. I’ll look into that function in usdView, I’m happy to walk it myself, just didn’t know how.
Thanks!