Table of Contents


Remove nodes from a set in Maya

In Autodesk’s Maya animation software, one can only wonder why it is so difficult to remove objects from sets. The following MEL script shows how you can do it more easily.

Example

Make sure that at least one object and one set is selected.

proc removeFromSet() {
    string $objectSets[] = `ls -sl -type objectSet`;
    string $selection[] = `ls -sl`;
    $selection = stringArrayRemove($objectSets, $selection);
    for ($set in $objectSets) {
        for ($sel in $selection ) {
            if (`sets -im $set $sel`) {
                sets -rm $set $sel;
            }
        }
    }
}

Usage

removeFromSet

See Also




comments powered by Disqus

See also