// =========================================================================== // 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. // =========================================================================== // global proc performPolyShellSeparate(){ string $selection[] = `filterExpand -sm 12 -sm 34`; if (size($selection)==0){ error((uiRes("m_performPolyShellSeparate.kSeparateSelectionError"))); return; } string $faceSelection[] = `filterExpand -sm 34`; int $activeShells[] = `polyEvaluate -activeShells`; string $selectedObj[] = `ls -sl -o`; if (size($faceSelection) != 0 && size($selectedObj) != 1){ error((uiRes("m_performPolyShellSeparate.kSeparateSelectionError2"))); return; } if (size($faceSelection) != 0){ select -r $selectedObj[0]; } string $cmd = "polyPerformAction(\" polySeparate"; int $numShells = size($activeShells); int $i = 0; for ($i = 0; $i<$numShells;$i++){ $cmd += " -sss " + $activeShells[$i]; } $cmd += "\", \"o\", 0)"; eval($cmd); }