// =========================================================================== // 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: polyUVHardEdgesAutoSeams() // // Description: // // Cut or select all hard edges in target meshs // // Input arguments // $cut - 0:Only select; 1:Select and cut // // Return value // string[] - Result edges // global proc string[] polyUVHardEdgesAutoSeams(int $cut) { if(size(`ls -sl`) == 0 && size(`ls -hl`) == 0) return {}; changeSelectMode -component; setComponentMask("edge"); select -cl; $hilite = `ls -hilite -dag -s -ni`; string $components = ""; for($poly in $hilite) { if(`nodeType $poly` != "mesh") continue; $components += "\""; $components += $poly; $components += ".e[*]\" "; } if($components == "") return {}; // No components to select eval("select -r " + $components); int $t[] = `polySelectConstraint -q -t`; polySelectConstraint -t 0x8000; int $sm[] = `polySelectConstraint -q -sm`; int $bo = `polySelectConstraint -q -bo`; polySelectConstraint -sm 1 -bo 0 -m 2; $result = `ls -sl`; polySelectConstraint -sm $sm[0] -bo $bo -m 1; polySelectConstraint -t $t[0]; if($cut) { $objComps = rearrangeSelection($result); for($comps in $objComps) eval("polyMapCut " + $comps); } return $result; }