maya to fbx with custom attributes
Question: I have a maya scene where each mesh has a list of custom attributes on the
shape node that I add dynamically using python.

    
    
    import maya.cmds as cmds
    import maya.mel as mm
    
    #get mesh objects.
    meshes = maya.cmds.ls(type="mesh")
    for mesh in meshes:
        cmds.select(mesh)   
    
    
        #check if attribute exists, if not, create.
        if not mm.eval( 'attributeExists "test" "%s"' % mesh): 
            cmds.addAttr( shortName='tst', longName='test', dataType="string")
    

When I export to .fbx and re-import, these attributes and their values are
gone.

How can I keep all these values upon export?


Answer: Unfortunately, you can't. From the [maya
docs](http://knowledge.autodesk.com/support/maya/learn-
explore/caas/CloudHelp/cloudhelp/2015/ENU/Maya/files/GUID-
AA3B8EA4-DDFB-4B0F-9654-2BF6B8781AE7-htm.html):

> You can export Maya transform node custom attributes to the user properties
> of FbxNode. However, you cannot export Maya shape node custom attributes,
> such as mesh node, to FbxGeometry. This is because FbxGeometry does not
> currently support user properties.

Your best bet is probably to try putting the custom attributes on a non-shape
node if possible, or else exploring other export formats like
[alembic](http://knowledge.autodesk.com/support/maya/learn-
explore/caas/CloudHelp/cloudhelp/2015/ENU/Maya/files/Alembic-Export-htm.html)
or your own custom format.

