OpenUSDPreview
Open in TheBrain

LIVRPS Strength Ordering

LIVRPS is an acronym for Local, Inherits, VariantSets, References, Payload, Specializes, and is the fundamental rubric for understanding how opinions and namespace compose in USD. LIVRPS describes the strength ordering in which the various composition arcs combine, within each LayerStack. For example, when we are trying to determine the value of an attribute or metadatum on a stage at path that subscribes to the value resolution policy that “strongest opinion wins” (which is all attributes and most metadata), we iterate through PrimSpecs in the following order looking for an opinion for the requested datum:

Local:

Iterate through all the layers in the local LayerStack looking for opinions on the PrimSpec at path in each layer - recall that according to the definition of LayerStack, this is where the effect of direct opinions in all SubLayers of the root layer of the LayerStack will be consulted. If no opinion is found, then…

Inherits:

Resolve the Inherits affecting the prim at path, and iterate through the resulting targets. For each target, recursively apply LIVRP evaluation on the targeted LayerStack - Note that the “S” is not present - we ignore Specializes arcs while recursing. If no opinion is found, then…

VariantSets:

Apply the resolved variant selections to all VariantSets that affect the PrimSpec at path in the LayerStack, and iterate through the selected Variants on each VariantSet. For each target, recursively apply LIVRP evaluation on the targeted LayerStack - Note that the “S” is not present - we ignore Specializes arcs while recursing. If no opinion is found, then…

References:

Resolve the References affecting the prim at path, and iterate through the resulting targets. For each target, recursively apply LIVRP evaluation on the targeted LayerStack - Note that the “S” is not present - we ignore Specializes arcs while recursing. If no opinion is found, then…

Payload:

Resolve the Payload arcs affecting the prim at path; if path has been loaded on the stage, iterate through the resulting targets just as we would references from step 4. If no opinion is found, then…

Specializes:

Resolve the Specializes affecting the prim at path, and iterate through the resulting targets, recursively applying full LIVRPS evaluation on each target prim. If no opinion is found, then…

Indicate that we could find no authored opinion

We have omitted some details, such as how, for any composition arc in the above recipe, we order arcs applied directly on the PrimSpec in relation to the same kind of arc authored on an ancestral PrimSpec in the LayerStack - the short answer is that “ancestral arcs” are weaker than “direct arcs”, and why we ignore the “S” when we recurse for the other arcs, which we discuss more in the entry for Specializes. It may sound like a great deal of work to need to perform for every value lookup, and it absolutely would be if we followed all the steps as described above, during value resolution. This is the reason that we compute and cache an Index for every prim on the Stage: the Index “pre-applies” the above algorithm to find all the PrimSpecs that contribute any opinions to the prim, and caches the list in a recursive data structure that can be very efficiently processed whenever we need to resolve some value on the prim.

The algorithm for computing the namespace of the stage (i.e. what prims are present and where) are slightly more involved, but still follows the LIVRPS recipe.

Attachments