USD StagesΒΆ

Working with USD Stages is pretty straight forward, as most times everything is one function call away.

To load a USD file as a USD Stage you use Usd.Stage.Open(path):

from pxr import Usd

stage = Usd.Stage.Open('path_to_file.usd')

To create a new Stage use Usd.Stage.CreateNew(path):

from pxr import Usd

stage = Usd.Stage.CreateNew('a_new_stage.usd')

To save a loaded Stage use Usd.Stage.Save(path)

from pxr import Usd

stage = Usd.Stage.Open('path_to_file.usd')
# do something to the stage
stage.Save()

To export a stage to a new file, you can use Usd.Stage.Export(). This function allows you to transition between serialization formats (usda or usdc) as well, based on the file extension provided.

from pxr import Usd

stage = Usd.Stage.Open('a_usda_file.usda')
# do something to the stage
stage.Export('a_usdc_file.usdc')