PDA

View Full Version : UV removal mel


Oddgit
02-19-2006, 03:57 PM
Hi, i was wondering what the best way was to remove all of the UV maps and sets from a scene?
I primarly model in Modo, and when i bring in the .ma file, it has extra and or messed up UVs that i did not create in modo. Is there a way to just type a few lines to get rid of all of them?

A_New_Hope
02-20-2006, 03:07 PM
not really sure if this is what you wanted by this code delete all UVsets exept the default one and delete the uv from all selected objects.


// select all objects
//select -allDagObjects;

// list the selected objects
string $objList[] = `ls -sl`;

// loop all selected objects
for ( $obj in $objList )
{
// get all UVsets from object
string $UVsetsList[] = `polyUVSet -q -allUVSets $obj`;

// loop throug all UVsets
int $q;
for( $q=0; $q < `size($UVsetsList)`; $q++ )
{
// so long its not the first uvset ( thats the default one )
if ( $q != 0 )
{
// select and delete the UVset
polyUVSet -currentUVSet -uvSet $UVsetsList[ $q ];
polyUVSet -delete
}
}
// delete objects UVs
DeleteUVs;
}

CGTalk Moderation
02-20-2006, 03:07 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.