Reputation: 58143
Recently Pixar released a plugin for working with USDA
file format in Maya. Also there's a USD API. With this API is easy to create a usdPrimitives
:
from pxr import Usd, UsdGeom
stage = Usd.Stage.CreateNew('HelloWorld.usda')
xformPrim = UsdGeom.Xform.Define(stage, '/hello')
spherePrim = UsdGeom.Sphere.Define(stage, '/hello/world')
stage.GetRootLayer().Save()
And then execute this Python script to create a .usda
file.
$ python extras/usd/tutorials/helloWorld/helloWorld.py
What Python command is used for export to a USDA
file format?
Upvotes: 0
Views: 1392
Reputation: 12208
The plugin supports loading and saving of documents in USD format but not creating geometry or scenes programmatically.
According to the docs for the plugins, the supported commands are USDImport
and USDExport
. The flags for the commands are documented on the link.
USDImport
and USDExport
are only available if you have loaded the USD plugin with the UI or programmatically. You can make sure the plugin is loaded with the loadPlugin()
command from the maya.cmds
module. Once it's loaded, call cmds.USDExport()
on your scene (the plugin will automatically register the import and export functions in maya.cmds
when it is loaded)
Upvotes: 1