Maya skinning - limit max influences

Just a quick question for the maya game skinning guys.

Are there any new tricks on keeping a vert in maya from going past a # of bones.

I have my skin cluster set to limit to 4 max but I am getting some strangeness during painting…

Just wanted to see if any one had a good game optomizing workflow for skinning as editing the vert weight spreadsheet is rough and paint is having issue with the “max influence” checkbox.

Thanks,
Brad

I keep it without the max limit and then run a script on the verts to make sure there’s no verts with more than 4, and if there set them to 0

you’ll get ‘vert popping’ during painting if you have that limit turned on, but usually only if you’re painting scale/smooth/replace while other joints are on hold. if you paint as ‘add’ only, you shouldn’t* get the vert popping problem.

the only other method that i did with that limit is to ignore it, paint/edit weights as usual, then when you’re happy, do a pruning and turn the limit on.

still, painting just using ‘add’ is my preferred method.

What kind of strangeness are you having when painting weights?

When I skin takes me a couple times to get my options right mostly edit the drop off rate sometimes the max influences also. After it is blocked out I go into the component editor and start fixing the weights this is where if I don’t want a bone effecting a vertex just assign it to 0. Last thing I do is go in and paint to smooth out some weights on those tricky areas.

I hope that helps.

yeah, the vert poping and some prune issues, just been a while since I had to care about game weight limits and wanted to check that there was not some fix or something I was missing.

I realllly wish that the skincluster code max influence box actually worked and that the rest of maya tools like smooth skin weights and the paint tool would respect the limit. Kind of a pain in the a$$ that it still does not work as expected, I have a few scripts to prune to 4 and to check for inf. over # i just need to dig them up from older maya installs.

i’ll send you my dagMenu proc later that will speed up your skinning 10-fold :slight_smile:

IM me when i’m on later…

Applebee’s, Denny’s, Outback wow gold, Wendy’s & Ruby Tuesday are offering unbelievable prices this summer.

I just discovered that one of the things that can break max influences is mirroring skin weights. Totally lame, Maya. I wrote a script to diagnose where the problem areas are:


global proc checkMaxSkinInfluences(string $mesh, int $maxInfluences)
{
    select -cl;
    string $skinCluster = `findRelatedSkinCluster $mesh`;
    if($skinCluster == "") error ("checkSkinInfluences: can't find skinCluster connected to '" + $mesh + "'.
");
    
    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 + "
");
    else print ("Found no verts with more than " + $maxInfluences + " on " + $mesh + "
");
}

Once this is run if there are any problems it will select the offending verts. Prune Small Weights at about 0.001 clears up most of it. And if you have skinCluster -maximumInfluences turned on then when you set the lower influence verts to zero in the Component Editor it pops back to the correct number of influences. I like to do this part manually so I can see how it affects the skin because anything above the Prune threshold is potentially noticable.

Sounds like a legit bug to me. I’m going to submit a bug report to Autodesk.

-David

very nice, Thanks David. It seems like they added the “feature” but never checked that the rest of the tools worked with it…gooftacular.

I’ve found the best way is to paint weights without any limits (but being mindful of your target influence number) then clean up afterwards.

Final cleanup I do a prune with very low value to get rid of painting artifacts, then use a custom tool of mine that highlights and/or automatically adjusts weights above a given number of influences. It’s also helpful to put a threshold value in there so any areas where the fifth influence is actually quite strong you can elect to fix manually.