Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // in button (for over 2):
- string $select[] = `ls -sl`;
- string $object = $select[0];
- checkMaxSkinInfluences($object, 2);
- // checkMaxSkinInfluences.mel
- global proc checkMaxSkinInfluences(string $mesh, int $maxInfluences)
- {
- select -cl;
- string $skinCluster = `findRelatedSkinCluster $mesh`;
- if($skinCluster == "") error ("checkSkinInfluences: can't find skinCluster connected to '" + $mesh + "'.\n");
- int $verts[] = `polyEvaluate -v $mesh`;
- int $count;
- int $i;
- for($i=0;$i<($verts[0]+1);$i++)
- {
- float $inf[] = `skinPercent -query -value $skinCluster ($mesh + ".vtx[" + $i + "]")`;
- float $activeInf[] = {};
- int $j;
- for($j=0;$j<size($inf);$j++)
- {
- if($inf[$j]>0) $activeInf[size($activeInf)] = $inf[$j];
- }
- if(size($activeInf) > $maxInfluences)
- {
- select -add ($mesh + ".vtx["+$i+"]");
- $count++;
- }
- }
- if($count > 0) warning ("More than " + $maxInfluences + " influences for " + $count + " verts on " + $mesh + "\n");
- else print ("Found no verts with more than " + $maxInfluences + " on " + $mesh + "\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement