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.
Place scSaveWeights.py in your plugin directory
scSaveWeightsWin.py in your python script directory. Make sure plug-in scSaveWeights is loaded in plug-in manager.
Usage via UI:
scSaveWeights -roundOff 5 -action "export" -file "d:/weights.txt"
scSaveWeights -action "import" -file "d:/weights.txt"