Feedback

What's your question?

  • Current version

    Back

    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();
    

    By: Julian Mann [ Admin ]

or Back