// =========================================================================== // 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: April 1, 2001 // // Description: // The bevelPlusPreset() procedure executes a // bevel plus operation. // // Input Arguments: // None. // // Return Value: // None. // proc string pieceTogetherCmd( int $asPolygons, float $tolerance, int $attach, int $bevelSidesNumber, float $bevelWidth, float $bevelDepth, float $bevelExtrudeDepth, int $caps, int $bevelInsideCurves, int $outerStyle, int $innerStyle, // Poly conversion options: int $pFormat, int $pCount, int $pTypeU, int $pNumberU, int $pTypeV, int $pNumberV ) // // Description : // Put together a bevel plus command // { string $cmd = "bevelPlus" ; // history always true (will delete it later if not needed) $cmd += " -constructionHistory true " ; // normalsOutwards always true (for >=v7.0 files) $cmd += " -normalsOutwards true " ; // curve range always false $cmd += " -range false " ; // output type (NURBS=0, // poly=1, // subd=2 // bezier=3 - NOT supported at present) $cmd += (" -polygon " + $asPolygons); // tolerance. $cmd += (" -tolerance " + $tolerance); // bevel number of sides. $cmd += (" -numberOfSides " + $bevelSidesNumber); // attach surfaces. // $cmd = $cmd + " -js " ; if( $attach == 1 ) { $cmd = $cmd + "true " ; } else { $cmd = $cmd + "false " ; } // bevel width. $cmd += (" -width " + $bevelWidth); // bevel depth. $cmd += (" -depth " + $bevelDepth); // bevel extrude depth. $cmd += (" -extrudeDepth " + $bevelExtrudeDepth); // caps $cmd += (" -capSides " + $caps); // bevel inside curves $cmd += (" -bevelInside " + $bevelInsideCurves); // curve styles $cmd += (" -outerStyle " + $outerStyle); $cmd += (" -innerStyle " + $innerStyle); if( 1 == $asPolygons ) { $cmd += (" -polyOutMethod " + $pFormat); $cmd += (" -polyOutCount " + $pCount); $cmd += (" -polyOutExtrusionType " + $pTypeU); $cmd += (" -polyOutExtrusionSamples " + $pNumberU); $cmd += (" -polyOutCurveType " + $pTypeV); $cmd += (" -polyOutCurveSamples " + $pNumberV); $cmd += (" -polyOutUseChordHeightRatio 0"); } return $cmd ; } global proc bevelPlusPreset( int $doHistory, int $asPolygons, int $attach, float $tolerance, int $bevelSidesNumber, float $bevelWidth, float $bevelDepth, float $bevelExtrudeDepth, int $caps, int $bevelInsideCurves, int $outerStyleCurve, int $innerStyleCurve, // Poly conversion options: int $pFormat, int $pCount, int $pTypeU, int $pNumberU, int $pTypeV, int $pNumberV ) // // Description : // Proc to do a plus bevel // { // History off case will be handled at the very end; so, things // will always be made with history, then the history will // be deleted. //--------------------------------------- // put together a bevel cmd. //--------------------------------------- // string $cmd = pieceTogetherCmd( $asPolygons, $tolerance, $attach, $bevelSidesNumber, $bevelWidth, $bevelDepth, $bevelExtrudeDepth, $caps, $bevelInsideCurves, $outerStyleCurve, $innerStyleCurve, $pFormat, $pCount, $pTypeU, $pNumberU, $pTypeV, $pNumberV ); //--------------------------------------------- // Get the list of nurbs curves in select list. //--------------------------------------------- // global int $gSelectNurbsCurvesBit; global int $gSelectIsoparmsBit; global int $gSelectCurvesOnSurfacesBit; global int $gSelectSurfaceEdgeBit; global int $gSelectMeshEdge; string $curveList[] = `filterExpand -ex true -sm $gSelectMeshEdge -sm $gSelectNurbsCurvesBit -sm $gSelectIsoparmsBit -sm $gSelectCurvesOnSurfacesBit -sm $gSelectSurfaceEdgeBit`; //-------------------------------------------- // Valid # of items. //-------------------------------------------- // int $curveCount = size($curveList) ; if( 0 == $curveCount ) { string $msg = (uiRes("m_bevelPlusPreset.kSelectionError")); error($msg); } else { int $i; for( $i=0; $i<$curveCount; $i+=1 ) { $cmd += (" \"" + $curveList[$i] + "\""); } string $result[] = evalEcho($cmd); if( !$doHistory ) { delete -ch; } } }