//copy-paste_faces.mel //By Christopher Evans - August 2003 //Copies selected faces to a new object. //This is similiar to the duplicate faces command, but works without seperating the mesh, //so it's great for taking selected parts off imported OBJs! //Chris@Dork.com - www.ChrisEvans3D.com //loads that selection string $original_sel[] = `ls -sl`; //selects entire mesh polySelectConstraint -type 0x0008 -shell true -mode 3; polySelectConstraint -shell false; //loads that selection string $original_obj[] = `ls -sl`; //select object of selected item string $sel[]=`ls -sl -fl`; string $buff[]; $tok=`tokenize $sel[0] "." $buff`; select -r $buff[0]; //loads that selection name string $original_mesh_name[] = `ls -sl`; //duplicate it and convert selection to faces duplicate -rr; //loads name of new object string $new_mesh_name[] = `ls -sl`; //get old original object selection (faces) select $original_obj; //deselect original and delete leftovers select -d $original_sel; delete; //rename duplicated object to original object name rename $new_mesh_name $original_mesh_name;