This one isn't great but it works despite the errors it throws. I also never knew color sets could be shared/instanced, kinda neat!
{
// get selected objects and check each for color sets, deleting them if found.
string $sel[] = `ls -sl`;
for ($obj in $sel){
string $colorSetList[] = `polyColorSet -q -acs`;
if (size($colorSetList) >1){
for ($colorSet in $colorSetList){
polyColorSet -delete;
}
}
if (size($colorSetList) <1){
print ($obj + " has no color sets." +"\n");
}
}
}
It works on a single object for me. I did notice that the color set editor doesn't immediately detect that sets were deleted, I have to reselect the object for it to refresh.
The color sets seem to only work based per object, so selecting one object at a time and deleting all the color sets, and then rotating that selection to the next object in your original selection and repeating, seems to run with no errors
Replies
{ // get selected objects and check each for color sets, deleting them if found. string $sel[] = `ls -sl`; for ($obj in $sel){ string $colorSetList[] = `polyColorSet -q -acs`; if (size($colorSetList) >1){ for ($colorSet in $colorSetList){ polyColorSet -delete; } } if (size($colorSetList) <1){ print ($obj + " has no color sets." +"\n"); } } }The color sets seem to only work based per object, so selecting one object at a time and deleting all the color sets, and then rotating that selection to the next object in your original selection and repeating, seems to run with no errors