Hi @haberlu , unfortunately there isn’t, and it’s difficult to imagine how there could be. It may be the case for the particular assets you are working with that all of the nested variants are laid out straightforwardly in child specs of the top-most variant specs, but because of the combinatorial nature of USD composition, that is not a requirement.
For example, each of your top-level variants might add a reference to a prim in another asset/layer, and that prim has an inherits to another prim that defines a variantSet with variants. Composition will make that all “work” so that the inner variantSet becomes a nested variantSet of your top-level variant. But without actually composing the variant in-question, you’d need to recreate the composition logic to find the inner variantSet and its variants.
This is a pipeline issue we’ve run up against ourselves when using nested variants. Our “solution” was not entirely satisfying or general… in our case the nested variantSet tended to be pretty uniform for each variant (it was LOD, nested inside a modelingVariant). So, as part of the “publish” step for each asset, we loaded it and iterated over each variant of the outer variantsets, discovering nested variantSets and their variants, unioning everything we found. Then, on a newly created spec for the asset (in an “interface” usda layer that simply payloads in the entirety of the asset) we added specs for each variantSet, and empty variant children for each.
The nested variantSets are no longer nested on this top-level spec, but that’s not harmful, as the nesting across the payload arc will still take place. You just are always able to see all the variants and select among them, however, some selections for the inner variantSet may not be valid, and you won’t know until you select and get a warning during composition. And that’s a big reason this scheme is unsatisfying.
I don’t think there’s any likely solution that doesn’t involve iterating through the composed variants… we could try to work out a standardized (likely dictionary) scheme for describing the variant nesting, as metadata available for GUI’s - and a utility for computing it for you, such that you can add it to the prims that contain variantSets. However, that’s a “baking” step, and if the asset contains live references, it could go stale due to upstream changes.
But if that sounds useful/appealing to folks, please file an Issue, and it’s also something that could be a nice external PR.