Scene Organization via USD Model Hierarchy#
Model hierarchy provides a simplified view of the full prim hierarchy for enhanced navigability.
The model hierarchy is broken down into the important points of interest, âcomponent modelsâ and âassembly modelsâ, as well as their containing âgroupsâ.
âComponent modelsâ are the leaves of the model hierarchy. They form a âcomponent model boundaryâ under which no other models may be specified.
Model hierarchies are intended to be âshallowâ compared to the full prim hierarchy.
Model hierarchy is both optional and forgiving, so donât get blocked maintaining it.
What is model hierarchy?#
Consider a very large factory scene, with thousands of entities of different types - robots, architectural structures, actors, etc. Each of these may contain hundreds or thousands of descendant prims (meshes, shaders, etc). It can be helpful for users to be able to quickly navigate to âimportantâ prims in the hierarchy. These prims of interest are often not the root prim of the stage nor the leaf meshes at the bottom of the hierarchy but rather the roots of the individual models the scene is constructed from.
The model hierarchy is identified through a single piece of prim metadata, Kind.
The language of model hierarchy#
Model hierarchy simplifies the Prim hierarchy into two key Kinds: assembly models and component models.
Warning
Be mindful that the usage of âassemblyâ and âcomponentâ in the context of OpenUSD model hierarchy does not often map to the concepts of âassemblyâ and âcomponentâ used in many industrial and manufacturing contexts.
In OpenUSD, the concept of a âcomponent modelâ aligns with complete, end-consumer-facing products. Products can vary in complexity and scaleâ buildings and pens are both products, whereas an individual screw typically is not.
Note
A âcomponent modelâ is not a âcomponent of a modelâ.
âComponent modelsâ are conventionally structured to be operational for simulation and rendering, with fully specified and organized geometry, materials, or physics data (if needed).
OpenUSD requires that all ancestors of âcomponent modelsâ are âgroupsâ. This âgroupâ Kind makes it easy for OpenUSD to identify during traversal whether or not a prim may have âcomponent modelâ descendants.
Note
A prim with kind=component that has any non-âgroupâ ancestors is not considered a valid model hierarchy element.
Some âgroupsâ are important points of interest. A factory that references other architecture models, equipment models, and actor models can be tagged as an âassembly modelâ. While âcomponent modelsâ are strictly leaf elements of model hierarchies, âassembly modelsâ can be nested (âassembly modelsâ are âgroupsâ). For example, an industrial park âassembly modelâ can reference multiple distinct factory âassembly modelsâ that are being maintained and organized in parallel.
Note
âAssembly modelsâ may contain their own geometry or materials outside of a âcomponent modelâ, but that is an uncommon structure and can lead to confusion when collaborating with others in scene assembly / data aggregation workflows.
Model hierarchy correctness is âgroupâ correctness#
A correct model hierarchy has two characteristics:
There are no âcomponent modelâ, âassembly modelâ, or âgroupâ descendants of âcomponent modelsâ
All ancestors of âcomponent modelsâ, âassembly modelsâ, or âgroupsâ must be a âgroupâ (or âassembly modelâ)
Due to their importance, users often take special care with maintenance of âassemblyâ or âcomponentâ tagging. Failing to tag intermediate organizational scopes with kind=group commonly leads to an incorrect model hierarchy.
Many connectors generate either âassembly modelsâ or âcomponent modelsâ. A user assembling a stage will likely create new organizational scopes to place the generated results of a connector. When model hierarchy is used, the user will need to tag the organizational scopes as âgroupâ (or âassemblyâ) to preserve the model hierarchy correctness.
Model hierarchy is more than a tag#
OpenUSD scales by reading only the essential fields during composition. It may be surprising that Kind is conditionally one of those fields. Kind will be read on all root prims and direct descendants of âgroupâ prims in the model hierarchy. Kind reads arenât more expensive than any other field but their cost is re-incurred during any recomposition.
A âshallowâ model hierarchy avoids this cost, amortizing the extra field read from the first few levels of the full prim hierarchy. The shallowness of the model hierarchy is measured by the placement of the âcomponent model boundaryâ. The remainder of the prim hierarchy can be structured as deep as needed to organize each âcomponent modelâ.
Due to the similarity of names, itâs not uncommon to see manufacturing and industrial tooling try to align kind=component with parts instead of products, generating âdeepâ model hierarchies. Itâs worth being mindful of the small performance and navigability costs, but a scene should still be operational even with âdeepâ model hierarchies.
Subcomponents arenât models#
The model hierarchy ends at the âcomponent model boundaryâ. Prims beneath this boundary are no longer part of the model hierarchy. OpenUSD allows important prims beneath the âcomponent model boundaryâ to still participate in Kind tagging. An example of an important descendant might be the root Xform of a door on a building. Important descendants of âcomponent modelsâ are tagged with kind=subcomponent. Filtering a building by its subcomponents lets users quickly locate a door intended to be opened or closed, without dealing with the clutter of all the other static meshes of the building. Many âcomponent modelsâ donât have any âsubcomponentâ hierarchies; donât assume they are needed.
Model hierarchy is optional#
While model hierarchy is a core feature of OpenUSD that improves navigability of the stage, it is optional. Scenes and workflows that do not benefit from the additional organizational tooling do not have to utilize it. Scenes with incorrect model hierarchies (ie. nested components or incorrect group specification) are expected to render and simulate the same regardless of the presence or absence of a correctly specified model hierarchy.
There is a tax to correct maintenance of model hierarchy. Users assembling scenes need to be aware of where the âcomponent model boundaryâ has been placed to ensure that all ancestors are properly tagged as âgroupâ prims and that no descendants are tagged with kind=group, kind=assembly, or kind=component.
Be aware of the rules of model hierarchy and how it can enhance a sceneâs navigability, but donât get blocked by it.