// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== proc deleteFace(string $selectedFaces[]) { //get the list of edges correspoding to the selected faces //select the edges string $edges[] = `polyListComponentConversion -ff -te $selectedFaces`; select $edges; //save edges in a set since IDs may change when faces get deleted string $edgeSet = `sets`; //delete the faces and select the border edges only delete $selectedFaces; select -r $edgeSet; } global proc performPolyDeleteElements() { global int $gSelectMeshesBit; global int $gSelectMeshVerts; global int $gSelectMeshEdge; global int $gSelectMeshFaces; string $objList[] = `filterExpand -expand false -selectionMask $gSelectMeshesBit`; string $vertList[] = `filterExpand -expand false -selectionMask $gSelectMeshVerts`; string $edgeList[] = `filterExpand -expand false -selectionMask $gSelectMeshEdge`; string $faceList[] = `filterExpand -expand false -selectionMask $gSelectMeshFaces`; if(size($objList) != 0) { select -deselect $objList; } if(size($vertList) != 0) { DeleteVertex; } else if(size($edgeList) != 0) { DeleteEdge; } else if(size($faceList) != 0) { deleteFace($faceList); } else warning( (uiRes("m_performPolyDeleteElements.kWarningNoVerticesEdgesSelected")) ); }