// =========================================================================== // 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 ShiftClickSmartDupe( int $dupType ) { int $nbObj = size(`ls -sl -dag`); if ($nbObj > 0) { if( $dupType == 1 ) duplicate; else if( $dupType == 2 ) instance; return; } int $doHistory = `constructionHistory -query -toggle`; int $index = 0; string $cursel[]; string $faces[] = `filterExpand -ex true -sm 34`; if (0 < size($faces)) { $faces = `polyListComponentConversion -ff -fe -fv -fuv -tf`; while( size($faces) > $index ) { $index = `polyNextSelectionBatch $faces $cursel $index`; string $res[] = `polyExtrudeFacet -constructionHistory $doHistory -keepFacesTogether 1 -divisions 1 -twist 0 -taper 1 -offset 0 -thickness 0 -smoothingAngle 30 -reverseAllFaces 0 $cursel`; if (size($res) > 0) select -add $res; } return; } string $edges[] = `filterExpand -ex true -sm 32`; if (0 < size($edges)) { manipComponentUpdate; // To update manip when undoing smart edge extrude (MAYA-84983) $edges = `polyListComponentConversion -ff -fe -fv -fuv -te`; while( size($edges) > $index ) { $index = `polyNextSelectionBatch $edges $cursel $index`; string $res[] = `polyExtrudeEdge -constructionHistory $doHistory -keepFacesTogether 1 -divisions 1 -twist 0 -taper 1 -offset 0 -thickness 0 -smoothingAngle 30 $cursel`; if (size($res) > 0) select -add $res; } return; } string $verts[] = `filterExpand -ex true -sm 31`; if (0 < size($verts)) { while( size($verts) > $index ) { $index = `polyNextSelectionBatch $verts $cursel $index`; string $res[] = `polyExtrudeVertex -constructionHistory $doHistory -width 0.5 -length 0 -divisions 1 $cursel`; if (size($res) > 0) select -add $res; } return; } }