PUBLISHED: August 14, 2019
Deprecation Notice: This article was written more than a year ago which means that its information might no longer be up-to-date. We cannot therefore guarantee the accuracy of it's contents.

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


comments powered by Disqus