combi
Hi all,

I'm trying to hook a bounding volume to a muscle smoothCompress weights attribute, without any succes...
Actually, it seems to work, but just once. Even when a try to force a refresh of the attribute via a getAttr command, it doesn't update.

The funny thig is that if I move the bounding volume, save, and reopen, the weights are clearly set according to the bounding volume. So I must be overlooking something somewhere...

Any advice?

Nicolas

P.S. I attached the graph I came up with, but I don't know if it will show up, as I can't seem to see it when previewing the post.
muscleSoup.png
Reply 0 0
pshipkov
Looks like the cMuscleSystem node does not get dirty flags from this plug. The blendShape node (the standard one) has similar problem.
One thing you can try is to getAttr and setAttr to the sMuscle node and see if this is going to force evaluate it.

Reply 0 0
combi
Hi Peter,
Thanks for this fast answer!
I noticed that even if I try to getAttr the weights, their values don't reflect the values it should have accordingly to the bounding volume...
For information, I wasn't able to connect from the multiAttributeTransfert to the muscle node via the connection editor, and have had to connect it via mel:


connectAttr multiAttributeTransfer1.outWeightList[0].weights cMuscleSystem1.weightsSmoothCompress;


Maybe my problems come from that?


On a side note, I wasn't able to get some information about the attribute type in the docs, like for other legacy maya nodes, where you can know if an attribute is a componentList, a floatArray, a point attribute, etc...

So I used the multiAttributeTransfert node, but I should try a attributeTransfert node instead...

I'll give it a shot today.


Nicolas

Reply 0 0
rayman
I think that currently your connection is correct. You can check attribute types using `getAttr -type node.attr` mel command.
weightsSmoothCompress is a TdataCompound array(multi). It contains only one data type per index which is double.
One thing you can try is to connect every element individually:

connectAttr multiAttributeTransfer1.outWeightList[0].weights[0] cMuscleSystem1.weightsSmoothCompress[0];
connectAttr multiAttributeTransfer1.outWeightList[0].weights[1] cMuscleSystem1.weightsSmoothCompress[1];
....
connectAttr multiAttributeTransfer1.outWeightList[0].weights[n] cMuscleSystem1.weightsSmoothCompress[n];

use similar script to automate this process:

$outputAttr = "multiAttributeTransfer1.outWeightList[0].weights";
$inputAttr = "cMuscleSystem1.weightsSmoothCompress";
$indexes = `getAttr -mi $outputAttr`;
for ($ix in $indexes){
connectAttr -f ($outputAttr+"["+$ix+"]") ($inputAttr+"["+$ix+"]");
}


Good luck!

Reply 0 0
pshipkov
Agreed.
Top level compound attributes do not propagate dirty flags by default. I think this is the case here.
Connecting all elements individually will work, but for many points this gets pretty slow i think.
Wonder when this will be fixed, if ever ...

Reply 0 0
Reply