Create a New Variant Set on a Layer

Pipeline Developer Look Developer

In this example, most variant sets come directly from DELTAGEN and may be edited in your Omniverse application. New variant sets may also be created. The following workflow creates a new variant set to toggle the visibility of both headrests.

Variants and Strength Ordering

Variants are affected by USD strength ordering - which is referred to by the acronym LIVRPS.

Variant Set Prim Location

Variant sets are defined on prims in the stage hierarchy rather than being standalone prims themselves. These variant sets can only modify prims and properties at or below their location in the hierarchy. Since both left and right headrests need to be modified, the variant set must be added to a prim higher than both headrests, but not higher than necessary. Keeping variant sets as close as possible in the hierarchy to the prims that they modify ensures optimal performance.

Note

As a best practice, avoid creating variant sets on the highest prims in the hierarchy unless required.

Using the Layer panel, insert Variant_HeadrestVisibility.usd as another layer. This layer can be created using the steps below.

  1. Open the project USD file in the Authored folder (ConceptCar.usdc).

  2. Navigate to the Layer panel and verify the Root Layer is set to be the authoring layer. If set correctly, the Root Layer should look like Root Layer (Authoring Layer) and any changes you make are applied to this layer.

  3. Select the Create Sublayer icon at the bottom of the Layer panel.

  4. Navigate to the Authored/SubUSDs folder. Enter the file name Variant_HeadrestVisibility` and click Save.

  5. Observe that the gray save icons to the right of the Root Layer, and the newly created Variant_HeadrestVisibility.usd layer, have both turned blue. This color change indicates there are unsaved changes on those layers. Click both of these blue save icons to save both layers.

Important

Double-click on the Variant_HeadrestVisibility.usd layer to set the layer as the authoring layer. Now that the new layer has been set up, the new variant can be created using it.

  1. Right-click on this prim and select Edit Variants. This automatically opens the Variant Editor panel. World > ConceptCar_3xf > ConceptCar > carInterior > frontSeatAllGroup

  2. In the Variant Editor panel, click on the Add New Variant Set button.

  3. Right-click on the new Variant Set in the list and select Rename Variant Set.

  4. Rename the variant set to “Headrests”.

  5. Right-click on the only Variant in the set and select Rename Variant.

  6. Rename this first variant to “Headrests_ON”.

  7. Click on the Headrests_ON variant. When selected, the variant turns blue to indicate it is now active.

  8. In the right pane of the Variant Editor, click on the Add Prim button to add a new prim to this variant set. In the Select Prims panel, navigate to the left headrest prim that you should modify:

World > ConceptCar_3xf > ConceptCar > carInterior > frontSeatAllGroup > frontSeatLGroup > frontSeatLxGroup > frontSeatHeadLGroup

  1. Select this prim using the Select button at the bottom of the Select Prims panel. If this button is not visible, the panel may need to be resized slightly.

  2. Use the Add Prim button again to add this right headrest prim to the variant set:

World > ConceptCar_3xf > ConceptCar > carInterior > frontSeatAllGroup > frontSeatRGroup > frontSeatRxGroup > frontSeatHeadRGroup

  1. Both prims that the variant modifies are now defined. Next, specify which properties must be changed. Click on the Add Property button on one of the target prims, and in the Select Properties panel, select visibility.

  2. Click Add To All Prims to add this property for both left and right headrests. The visibility property can now be seen on each target prim and is set to a default value of inherited for both prims. For this setup, inherited is synonymous with visible. This is exactly what is needed for the ON variant.

  3. Next, create the OFF variant by right-clicking on the Headrests_ON variant in the list and select Duplicate Variant.

  4. Right-click on this new variant (Headrests_ON_1) and select Rename Variant. Rename it to Headrests_OFF.

  5. Click on the Headrests_OFF variant to make it active.

  6. You have now completed all of the tasks to add target prims and properties. The only remaining tasks you need to perform is to redefine the state of the visibility property for this variant. Click on the dropdown box for each prim and change its value from inherited to invisible. Now, when you choose to activate each variant, the headrest geometry can make the variant either visible or not visible in the Viewport.

  7. Close the Variant Editor and save the layer.

../_images/new-variant-set_1.png