// =========================================================================== // 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. // =========================================================================== // // // Creation Date: Nov 4, 1999 // // Procedure: // doSubdCrease // // Description: // Crease edge/vertex. // global proc doSubdCrease( int $state, int $full ) // // Description: // full (=1) or simple (=0) // state is sharp (=1) or not (=0) { // check that the user has a component on a subd selected string $activeSubdsNow[] = `ls -sl -objectsOnly -type subdiv`; if( 0 == size($activeSubdsNow) ) { string $currSel[] = `ls -sl -showType -objectsOnly`; if ( 0 == size($currSel) ) { string $msg = (uiRes("m_doSubdCrease.kNothingSelected")); error($msg); } else { string $msg = (uiRes("m_doSubdCrease.kInvalidSelection")); error (`format -stringArg $currSel[1] $msg`); } } subdivCrease -sh $state; if( $state && !$full ) { // Perform the partial crease by going down // to the next level and uncreasing. Calling // subdivCreateRegion will change the display // level, so keep track of the levels so you can // reset them afterward. // string $activeSubds[] = `ls -sl -objectsOnly -type subdiv`; int $oldLevels[], $i; for( $i = 0; $i < size( $activeSubds ); $i++ ) { $oldLevels[$i] = `getAttr ($activeSubds[$i] + ".displayLevel")`; } subdivCreateRegion; subdivCrease -sh off; for( $i = 0; $i < size( $activeSubds ); $i++ ) { setAttr ($activeSubds[$i] + ".displayLevel") $oldLevels[$i]; } } }