// =========================================================================== // 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: // subdIntoPolyMode // // Description: // Given a subdivision surface (with no construction history), // create a polygon. For more details see the description // with "subdiIntoPolyMode" function below. // global proc subdIntoPolyMode( int $hookAsHistory, int $allowHistory, int $templateSubd ) // // Description: // If $allowHistory is set, we will try and find a polygon in the // history of this object, delete that polygon's blind data of // the "hierarchical edits" type and put the new blind data on // the polygon shape. If $allowHistory is not set, we will fail // if the subd has history in the first place. If there is no // history on the subd, $allowHistory is ignored. In that case, // we will make a new polygon (using "point position" option and // the base mesh on the subd -> poly conversion) and give it the blind // data that represents the hierarchical edits. If $hookAsHistory is // set, we will then plug everything through polyToSubdiv node into // the subd we started with. Otherwise, we just leave it be. Note // that subd -> poly must be done without history, or we can end up // with a loop. { global int $gSelectSubdivSurface; string $list[] = `filterExpand -ex 1 -fp 1 -sm $gSelectSubdivSurface`; int $len = size($list); if( 0 == $len ) { string $msg = (uiRes("m_subdIntoPolyMode.kSelectError")); error($msg); return; } // Do each one in turn... int $i; for( $i=0; $i<$len; $i+=1 ) { subdGivenIntoPolyMode( $list[$i], $hookAsHistory, $allowHistory, $templateSubd, 0 ); } }