I'm trying to select several objects and move any uv set not "map1" to map1 and delete the leftover, now unused, uv set. I pulled a mel script I found off another thread. However when you have multiple objects selected it errors on line 7 saying it "Doesn't work for muliple objects selected." I'm guessing it's a diff from versions. I pulled the script from a 2012 thread. I've removed line 8 when I use it as it tries to delete the default set. Any help appreciated. I'm an artist, not much of a scripter.
{
string $selectedObjects[] = `ls -sl`;
int $selectionSize = `size($selectedObjects)`;
for ($i = $selectionSize; $i > 0; $i--){
polyUVSet -currentUVSet -uvSet "uvSet" $selectedObjects;
polyCopyUV -uvSetNameInput "" -uvSetName "map1" -ch 1 $selectedObjects;
polyUVSet -currentUVSet -uvSet "uvSet" $selectedObjects;
polyUVSet -delete $selectedObjects;
// DeleteHistory $selectedObjects;
}
}
Replies
Here ya go. It was trying to access an array instead of an individual object.