Maya-USD plugin
The maya-usd plugin provides command to export/import Usd files. It is provided by the usd_maya pak: make sure to have it in your oz environment before starting Maya.
To load the plugin simple type:
loadPlugin mayaUsdPlugin;
Exporting USD files
The mayaUSDExport can be used to export a Maya scene to a USD file.
The behavior of the command is similar to other exporters, e.g. wmBake:
usdExport -file "/my/output/file.usda"
To export an animated selection between frames 100 and 150:
usdExport -file "/my/output/file.usda" -frameRange 100 150 -selection
Wig provides an exporter plugin in order to support the wmWigFurNodes
,
wmWigGCDeformers
, and the wmWigSkinningNodes
. If Wig is loaded in the environment when the mayaUSDExport command is executed, then these nodes are automatically converted to the equivalent USD prims.
You can also export paintable attributes on skin and paint mesh. This operation uses a custom attribute called
USD_UserExportedAttributesJson
which contains a json
payload describing the custom attributes to be exported and their naming in the USD stage.
For example, the description of DensityScale:
"DensityScale": { "usdAttrType": "primvar", "interpolation": "vertex", "usdAttrName": "wig:DensityScale"},
This results in:
double[] primvars:wig:DensityScale = [1, .0.10,1] (
interpolation = "vertex"
)
Importing USD files
The mayaUSDImport command can be used to import a USD file into native Maya nodes. If you have the WigMayaUSD plugin loaded, you can import Wig schemas automatically. This creates a Fur Node.
Paintable attributes can now be imported via an import chaser for MayaUSD that recreates the paintable attributes and reconnects with the fur node.
Note
Import of paintable attributes is only supported in latest versions of MayaUSD based on USD 2111 and up (only available in Maya 2022.4 and 2023.0 and up).
import maya.cmds as cmds
cmds.mayaUSDImport(
file='/home/me/maya/projects/default/scenes/myscene.usd',
chaser=['Wig'],
pp='/')