llorens
Hey good question! I believe we've prototyped some tools for this sort of thing internally. But in the meantime you could use python to manipulate weight maps. I'll assume for the time being that you're manipulating maps for geometry that matches topologically.
There's faster ways to get/set deformer weights but I'll just show some basic lines of code so you can get an idea of what's going on.
Let's say you want to get the weight map for an attachment:
attachment_name = "zAttachment1"
attachment_weights = list(mc.getAttr("%s.weightList[0].weights" % attachment_name))[0]
And then here's a function to invert any weight list.
def invert_weights(weight_list):
out_weights = list()
for w in weight_list:
out_weights.append(1.0-w)
return out_weights
So now you can pass the attachment weights to the invert_weights function, and then apply the inverted weights to, say, a material layer:
inverted_weights = invert_weights(attachment_weights)
zmaterial_name = "zMaterial2"
for i, w in enumerate(inverted_weights):
mc.setAttr(zmaterial_name+".weightList[0].weights[%i]" % i, w )
Just a trivial example there, but hopefully gives you an idea 🙂
Andy