Feedback

What's your question?

By: Asked

Maya, Remove blendshape leaves, weight[#] space

Can we get rid of this clutter....? After using 'remove blendshape'...blend targets are removed but are replaced with 'weight[#]'

Since I a new user I'm not allowed to insert images, Here's a link to what I'm describing. http://www.joel3d.com/images2010/RemoveBlenshapeProblem.jpg

  • 0

julian [ Admin ]

I know the MEL command to remove an element of a multi is:

removeMultiInstance

It wouldn't be hard to make a script to check for weights with no associated targets and remove them.

You could add the code to: $MAYA_LOCATION/scripts/others/doBlendShape.mel so they always disappear.

EDIT: Seems like it always renames those attributes from "target_name" to "weight[?]" when it removes the target. So this script is a bit naive and just removes attributes named weight[?]. It may well fall apart on a real scene ;)

global proc cleanUpBlendShapeWeights(){
    string $bs[] = `ls -sl -type "blendShape"`;
    for ($b in $bs) {
        string $weights[] = `listAttr -m ($b+".weight")`;
        for ($w in $weights) {
            if (`gmatch $w "weight\\[*\\]"`) {
                removeMultiInstance ($b+"."+$w);
            }   
        }
    }
}

Save as cleanUpBlendShapeWeights.mel and source it. Then pick the blendShape nodes and type in the scriptEditor

cleanUpBlendShapeWeights();
NN comments
or Cancel