// =========================================================================== // 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. // =========================================================================== // // Procedure Name: // polyConvertToRingAndSplit // // Description: // This procedure selects the ring for a selected edge // and then splits the ring. // // Input Arguments: // None. // // Return Value: // None. global proc polyConvertToRingAndSplit() { // get the input edges getEdges(); // Flatten to make sure the later size() call handles full vtx selection. string $edges[] = `ls -sl -fl`; // split the ring if a poly edge is selected if (size($edges) > 0) { // also, make sure the selection is only 1 edge so the resulting // split ring looks as expected if (`size $edges` > 1){ warning (uiRes("m_polyConvertToRingAndSplit.kMultipleEdgeSelected")); // convert to a single ring select -r $edges[0]; } string $buffer[]; int $numTokens; $numTokens = `tokenize $edges[0] "[]" $buffer`; string $cmd; $cmd = "polySelect -edgeRing "; $cmd += $buffer[1]; eval($cmd); $cmd = "polySplitRing -rootEdge "; $cmd += $buffer[1]; $cmd += " -splitType 1 -weight 0.5"; eval($cmd); } else { warning (uiRes("m_polyConvertToRingAndSplit.kConverToRingSelectAnEdge")); } }