Exercise: Components#

For this exercise, we will set the model kind metadata on the default prim to make this asset a component asset.

  1. In Visual Studio Code, open the following file: asset_structure/exercise_09/set_model_kind.py

  2. Let’s use Usd.ModelAPI to set the component kind on the asset entry point. Add the code below into the block:

1Usd.ModelAPI(default_prim).SetKind(Kind.Tokens.component)
  1. Save the file and then execute the script using the following command:

Windows:

python .\asset_structure\exercise_09\set_model_kind.py

Linux:

python ./asset_structure/exercise_09/set_model_kind.py
  1. Run the following command in Visual Studio Code to open the file in usdview:

Windows:

.\scripts\usdview.bat .\asset_structure\exercise_09\lrg_bldgF.usd

Linux:

./scripts/usdview.sh ./asset_structure/exercise_09/lrg_bldgF.usd
  1. In usdview, click on the “World” (default) prim in the tree view. Note that the Meta Data tab shows that the kind field is set to component. This is a component asset now.