Maya.cmds.skinPercent query influence list


#1

cmds.skinPercent(‘skinCluster1’, t=1, q=1) won’t work.

cmds.skinPercent(‘skinCluster1’, t= None, q =1) will work:)


#2

Both do not work here.
But this works…

cmds.skinCluster(‘skinCluster1’, q=True, inf=True)

David


#3

I’ve been working on some weight tools lately, here are my 2 cents:

skinPercent works for components, not objects. It gives you the weight or the influences from a selected component. You need to select a component to make it work.

If you use t=None, it will return the influences for that component. It’s obviously the same result if you get the influences directly from the Skin Cluster.

If you use t=“name of the joint”, it will return the value for that influence. I’ve found this is useful when you don’t need weights on certain influences, but you still need those influences to be attached to the skin cluster.

And btw, for changing weights, don’t use skinPercent, it is extremely slow. Use setAttr instead. It’s like 3 times faster.


#4

Actually, I think setting weight won’t cost too much time. It’s really costing time to find out the symmetry components.


#5

Querying the components nodes is pretty fast, and better if you do it with OpenMaya.
Here is a script I use (not my script, but pretty useful as a reference)

http://www.creativecrash.com/maya/script/n_mirrorcomponents

We were using a free weight related script someone found in the internet but it was incredible slow. I took a look and only by changing skinPercent to setAttr and add some conditionals to ignore 0 weights, I managed to make it like 20+ times faster.


#6

great, I think ‘getClosestPoint’ does the job. I can create a lot more useful skin tools base on them.


#7

This may be of interest.
http://www.djx.com.au/blog/2015/03/09/barycentric-coordinates-part-2

David