get skinCluster influence list on selected vertex

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  10 October 2010
get skinCluster influence list on selected vertex

Hi,
Is there any command to get the skinCluster influence list on selected vertex, like in component editor, when you select one or more vertices, it will display the influences and their weights on those vertices.

Thanks,
Jefri
 
  10 October 2010
As far as I can tell, you can only get a list of influences for the skinCluster. Just get the weights for the vertex, and then filter the influence list by influences whos' weight value is larger than 0.
__________________
www.nathanhorne.com - Technical Artist
 
  10 October 2010
yeah, it seems to be the only way to retrieve it. Thanks.
If anyone has better idea of how to do it, please share here.
 
  10 October 2010
There is a way to do it

mel:
skinPercent -q -transform "skinCluster5" "symetricalHead.vtx[35]";

Python:
mc.skinPercent('skinCluster5', 'symetricalHead.vtx[35]', query=True, transform=None)

Hope it is what you need.
__________________
Sasha

Steampunk (Video)
Musi panels: A, B, C
 
  10 October 2010
Originally Posted by musi: There is a way to do it

mel:
skinPercent -q -transform "skinCluster5" "symetricalHead.vtx[35]";

Python:
mc.skinPercent('skinCluster5', 'symetricalHead.vtx[35]', query=True, transform=None)

Hope it is what you need.


Yeah, I figured out it's one of the way to get all the influence of selected vertices, but it also lists influences with zero value, so I still need to remove the zero influences from the list. Thanks anyway .
 
  10 October 2010
r4inm4ker, would you post it when you find the way of doing it?
I am looking for the same thing too...

Thanks
__________________
Sasha

Steampunk (Video)
Musi panels: A, B, C
 
  10 October 2010
well, In the end I just queried all the influences and the weight of each influence to that vertex, and then removed the zero ones, using codes similar to this: (it's taken from http://mayamel.tiddlyspot.com/ , slightly modified)


 // get transforms (binding joints and influence object)
 string $skinInfluences[]=`skinPercent -q -t $skinCluster $vtx`;
 // get skin weight of selected vertex
 float $sknVals[]=`skinPercent -q -v $skinCluster $vtx`;
 
 // only print values that are greater than 0.  If you want to know 
 // influence names even if they are zero, remove the 'if' line:
 for($i=0;$i<size($skinInfluences);$i++)
 {
 	if($sknVals[$i] > 0)
 		print ($skinTrans[$i] + "\t\t" + $sknVals[$i] + "\n");
 }
 
 
 
  10 October 2010
Thank you,
That's what I am doing too... I was hoping you found an easier way of getting those influences without zero ones.

Well, we will have to leave with what we have
__________________
Sasha

Steampunk (Video)
Musi panels: A, B, C
 
  11 November 2010
Hi,

I found a flag on skinCluster, that returns all weighted (non-zero) influences for the whole skinCluster, and it works both in Maya 2010 and 2011:

mc.skinCluster('skinCluster10', q=1, weightedInfluence=1) #Pyhon
skinCluster -q -weightedInfluence "skinCluster10"; //mel

And the skinPercent returns weighted (non-zero) influences for the given vertex in Maya 2011, but not in Maya 2010. They have changed the behavior of this command.

So, if you script for Maya 2011 - there is no need for looping through influences
__________________
Sasha

Steampunk (Video)
Musi panels: A, B, C
 
  11 November 2010
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:54 AM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.