Extract deformer to weight map

This is a code snippet that you can use to extract the envelope weights of a deformer to a weight map.

xsi = Application
oWeightMap = xsi.Selection(0)
oObj = oWeightMap.Parent3DObject
oEnv = oObj.Envelopes(0)
defOneArray = oEnv.GetWeights2().Array[1] # Change Array index to get a different deformer
oWeightMap.Elements.Array = [x / 100 for x in defOneArray]