scSaveWeights for export/importing skinCluster weights in Maya
I have written an useful Maya python API plugin which exports out weights from polygon mesh or vertices to text file(optionally binary),Which can be used later.
This process is mostly useful when User wish to change position of joints in a rig with skinCluster , or just want to update rig file with latest weights from other file.
I have in past used Michael comets famous Mel script cometSaveWeights, which works great but is very slow when importing weights on dense mesh.
It was my first attempt at writing something in Maya API. Attached in plugin which I have tested on Maya 2008 to 2011. Right now its command line but UI is coming soon.
Mel Command to export weights
scSaveWeights -roundOff 5 -action “export” -file “d:/weights.txt”;
Mel Command to import weights
scSaveWeights -action “import” -file “d:/weights.txt;
Download
scSaveWeights.zip
Go to windows>Settings/prefrence > plug-in manager and browse to the scSaveWeights.py
I would suggest to open the py file in IDE and read through comments in the beginning of script.
Exporting weights on polygon mesh with vertex count 12432 skinned with 255 joints took 7.6378 seconds
whereas Importing took 66.3445147672 seconds and in quick mode it takes 19.937 seconds while exporting
and takes 7.5559 seconds while importing.
Importing weights with cometSaveWeights.mel took more than 7 minutes on same Mesh.
edit: updated script to work with selected polygon object and in component mode, while importing weights.

January 23, 2012 at 2:51 pm
Nice job, man!
February 4, 2012 at 9:31 am
Hi there, I’d like to thank you for your handy plugin; but I’d also like to ask you a few questions.
Do you know how the list of vertices in the exported file relates to the list of vertices you’d get in an OBJ file? I’m trying to work your plugin into my mesh animation pipeline in my game project but I’ve run into a major issue:
I can’t seem to find a relation between the vertices in the OBJ file and yours. Do you know why this might be? I would have assumed that everything exports from Maya in the same fashion. Do you know of a possible solution?
Thanks.
February 4, 2012 at 11:22 am
Hi Derek, I am releasing one update to my plugin, as there are small issue while importing skin weights, (in current version only selection of vertices works)
That said my plugin saves out skinweights as per vertex id, if your obj file has different mesh order, I’m afraid you will get uneven weights.
I hope to update it near future, Thanks Sunny
February 21, 2012 at 8:37 am
wow! what a nice plug-in.