ntashev
Hi.
Here is the scenario:
I have a node which has an array attribute of doubleArrays like so:

weights
weights[0]
weights[1]
weights[2]
I want to set them up somehow, so you can select which attribute to paint in the Paint tool properties window.

the attributtes are of type MFnTypedAttribute ( MFnData.kDoubleArray), with setArray(true)

I've tried with
       
Code:
       

makePaintable -at "multiDouble" "node" "weights";

but this way it generates a new child on every stroke. If I add the -shapeMode "deformer" option there is an error, and the paint gets disabled.

Any ideas? Thanks.
pshipkov
I am not 100% sure about the exact structure of the multi attribute. Is it like the skinCluster/blendShape where we have multiple paintable "influences" or "targets", or it is like the cluster deformer - where we have array per shape ?
Reply 0 0
ntashev
Actually I only need one array of double arrays, and want to be able to select the one to paint on. I don't need any other fancy stuff like shape-weights relationship or things like that. Just an array to which I can add/remove elements (doubleArrays) and the new ones show up as paintable attributes like:
Node.weight[0]
Node.weight[1]
Node.weight[n] .. etc.
Reply 0 0
pshipkov
In this case why don't you just use an array attribute ?
It is faster than the multi attribs for accessing/editing/painting/etc.

Reply 0 0
ntashev
Here is the code:
cnmPaintDummy.txt
I want to be able to paint on the weights[*] attribute. If you have the time I'll be glad if you can take a look. The compute is pretty messed up for the moment, but I just wanted to make sure that the arrays exist before trying to paint.

Reply 0 0
ntashev
I give up, here is the code:
cnmPaintDummy.txt
I want to be able to paint on the weights[*] attribute. If you have the time I'll be glad if you can take a look. The compute is pretty messed up for the moment, but I just wanted to make sure that the arrays exist before trying to paint.

Reply 0 0
pshipkov
Just to make it clear - if you base your node on the MPxDeformerNode class then things will just work, by just registering the weightList attribute as paintable (there is an example in the makePaintable command help page about exactly that.
But even you create the multi attribute yourself, but it has the same structure as the regular weightList attribs then the same line from the makePaintable page should work.
Or maybe i miss your point here.

Reply 0 0
Reply