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.