import maya.cmds as cmds
selected_objects = cmds.ls(selection=True)
# Loop through each selected object and export it as a USD file using its name
for obj in selected_objects:
# Get the short name of the object (without the full path)
short_name = cmds.ls(obj, shortNames=True)[0]
cmds.select( short_name )
# Set the export path based on the object's name
export_path = "C:/your/folder/location/" + short_name + ".usda"
print( export_path )
print( "\n" )
cmds.file(export_path, force=True, type="USD Export", options=";exportUVs=1;exportColorSets=1;exportComponentTags=1;defaultMeshScheme=catmullClark;defaultUSDFormat=usda;parentScope=Arnold_Data;jobContext=[Arnold];materialsScopeName=mtl", exportSelected=True)
May we collect and use your data?
Learn more about the Third Party Services we use and our Privacy Statement.May we collect and use your data to tailor your experience?
Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.