Exercise: Components#
For this exercise, we will set the model kind metadata on the default prim to make this asset a component asset.
In Visual Studio Code, open the following file:
asset_structure/exercise_09/set_model_kind.py
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)
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
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
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 tocomponent
. This is a component asset now.