MEL: Remove objects from sets
One can only wonder why Autodesk has never added a simple command to the standard menus for removing objects from sets. Instead the normal user has to go through the Relationship Editor to remove objects. Here’s a command that simplifies the process.
Usage: removeFromSet
Make sure you have selected at least one object and a set
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;
}
}
}
}
No comments yet