Create Variant Packages#

Pipeline Developer Web Developer

Prerequisite - Local Testing#

At the conclusion of this section, all main elements are in place to test the initial content locally on a desktop PC. This is a strategic time to verify the kit-app-template USD Viewer is ready. You should iterate on the content and web page using React, as it is faster to do this locally now than after deployment.

  • A sample React web application can be used to communicate with USD Viewer, stream the configured asset into a browser, and set variants. It can be cloned from GitHub here.

  • To build and run the web application, refer to the Quick Start documentation on GitHub.

Additional Reading#

For additional React App examples, also read Embedded Web Viewer Example for Kit 105.1.2 based applications.

  • Before starting the following section, read the additional material listed here before moving on to packages. Even though it is for a previous version of Kit, many concepts still apply. This knowledge helps lay a foundation for application streaming libraries and how they relate to the sample React Application, and also helps you understand how to integrate these libraries into your own web page as needed.

Options and Packages#

A package, sometimes referred to as a “trim level”, is a group of options intended to work together for a predefined product offering. Packages are most commonly seen in automotive industries.

The most effective way to define a package is to group together USD Variants using an external USD mechanism and manage that from your React Web Page. A CSV file is used to represent the NVIDIA database and define the packages. The sample below can be used as a guide to replacing the CSV structure with the project’s unique database of options.

_images/creating-variant-packages_1.png

Package data, for use by a web application, is controlled by two CSV files (Options and Packages) that follow a predefined structure. If the CSV files follow this structure, they can be used as inputs to a JSON conversion sample script, which is more suitable for web use.

The first CSV file is an Options csv, and should contain every available option for the asset. In this context, an option can be thought of as a USD variant, along with other necessary data for setting it (such as the prim path and variant set).

The other CSV file is a Packages CSV, and provides groupings of packages. The Packages CSV should map an arbitrary amount of IDs from the Options CSV to a named package.

These files are provided in the 03_ConceptCar_Example_106.0.3/Configured/Data folder in the Sample Assets.

The JSON conversion sample script receives the Options and Packages CSV files as inputs and writes to disk a JSON file that merges the information from the two. This resulting JSON explicitly lists the required information (i.e. prim path, variantSet, variant name) associated with each package, which can be iterated through for use within a web application.

Topics