Export custom attributes with USD to Unreal Engine

Hello guys,

How can I export custom string attributes from Maya 2023 to USD?

Create a cube in Maya, add string attribute, and import it back - attribute lost. I could export primitive attributes from Houdini, but after importing it in UE I do not see it anywhere.

Heya, for exporting attributes from Maya to USD it looks like you need to add another attribute named USD_UserExportedAttributesJson and add a bit of info in there for the exporter code to read.

This should encourage the USD export commands to export a primvar named myAttribute on myNode in the generated cache.

cmds.addAttr(‘myNode’, ln=‘USD_UserExportedAttributesJson’, dt=‘string’)
thejson = “{‘myAttribute’ : {‘usdAttrName’:‘myAttribute’, ‘usdAttrType’:‘primvar’}}”
cmds.setAttr(‘myNode.USD_UserExportedAttributesJson’, thejson, type=‘string’)

If you want a non-primvar, regular USD attribute like I did omit the ‘usdAttrType’ bit of the json.

I haven’t worked out the reading it back part yet, but looks like it will be related to some chaser code you attach to the import command.

1 Like