Hi all,
I define a deformer node, like this:
class MyDeformer : public MPxDeformerNode

devkit/plug-ins/weightListNode.cpp shows that MPxDeformerNode::weightsList is an array-array attribute.
MPxDeformerNode::weightsList has the child attribute weights which is also an array.

I guess that I could store weight of vertex of different meshes into this attribute, like the following steps:
1. create a instance node of MyDeformer "myDeformer0";
2. set weight of vertex of mesh0 in this way:
setAttr "myDeformer0.weightsList[0].weights[0]" 0.0;
setAttr "myDeformer0.weightsList[0].weights[1]" 0.1;
setAttr "myDeformer0.weightsList[0].weights[10]" 1.0;

3. set weight of vertex of mesh1 in this way:
setAttr "myDeformer0.weightsList[0].weights[0]" 0.0;
setAttr "myDeformer0.weightsList[1].weights[1]" 0.1;
setAttr "myDeformer0.weightsList[1].weights[10]" 1.0;

I set the attribute weights to be paintable in this way:
   makePaintable "myDeformer" "weights" -attrType "multiFloat" -sm "deformer";
If I select node "myDeformer0" and run this mel command:
   evalEcho("artAttrToolScript 3 \"myDeformer\"");
then I can paint the weight in Maya Editor Window, and the values will be stored into "myDeformer0.weightsList[0].weights[*]".

But, my question is, how to paint the values of myDeformer0.weightsList[1].weights?
I know I can set the values of myDeformer0.weightsList[1].weights[*], but it's not painting.
What the artists needs is painting the weight in Maya Editor Window.
Could you give me any clue?

Quote 0 0
I think you should write your own paint tool.
My advice is to even not use this weights structure since it is very slow to allocate and iterate on it.
Instead define multi array attributeof double arrays.
Then create one placeholder double array attribute. Make it paintable.
Then from the gui when you select given target you copy (connect/disconnect) the corresponding doublearray index to the placeholder double array and connect the placeholder array attribute to the one associated with the target. This way you propagate the painted values to the target weights.
This is both fast and simple.
For example this is how the paint skin weights tool is doing it.
The only difference is they are not using array of doublearrays as i suggested above for the mentioned reasons.
Quote 0 0