// =========================================================================== // 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: 14 January 1999 // // // Procedure Name: // cutCurveToolScript // // Description: // create wrapper around the cutCurve command // // Input Arguments: // 0 ==> do the command. // 1 ==> show the action option box // 2 ==> return the command // 3 ==> show tool option box // 4 ==> enter the tool // // Return Value: // None. // global proc cutCurveToolSetup( int $forceFactorySettings, string $goToTool ) { if( $forceFactorySettings || !`optionVar -ex cutCurveEuc` ) { optionVar -iv cutCurveEuc 1; } if( $forceFactorySettings || !`optionVar -ex cutCurveLac` ) { optionVar -iv cutCurveLac 0; } if( "" != $goToTool ) { scriptCtx -e -euc `optionVar -q cutCurveEuc` $goToTool; scriptCtx -e -lac `optionVar -q cutCurveLac` $goToTool; } } global proc cutCurveValues ( string $toolName ) { performCutCurve 3 $toolName; scriptCtxCommonValues( $toolName ); } global proc cutCurveProperties() { scriptCtxCommonProperties; } proc createCutCurveContext( string $tool ) { if( ! `scriptCtx -exists $tool` ) { cutCurveToolSetup( 0, "" ); int $n = 0; if( `optionVar -q cutCurveLac` ) { $n = 2; } scriptCtx -i1 "cutCurves.png" -title (uiRes("m_cutCurveToolScript.kCutCurveTool")) -bcn "cutCurve" -exitUponCompletion `optionVar -q cutCurveEuc` -totalSelectionSets 1 -expandSelectionList true -fcs ("cutCurveToolScript 0") -setNoSelectionPrompt (uiRes("m_cutCurveToolScript.kSelectTwoCurves")) -setSelectionPrompt (uiRes("m_cutCurveToolScript.kSelectSecondCurve")) -setAutoToggleSelection true -setAutoComplete `optionVar -q cutCurveLac` -showManipulators true -setSelectionCount $n -nurbsCurve true -curveParameterPoint true -editPoint true $tool; } } global proc string cutCurveToolScript( int $setToTool ) // // Description : // 0 ==> do the command. // 1 ==> show the action option box // 2 ==> return the command // 3 ==> show tool/action option box // 4 ==> enter the tool/do the command { string $tool = ""; if( $setToTool > 2 ) { if( !`optionVar -q modelWithToolCutCurve` ) { $setToTool = 4 - $setToTool; } else { $tool = "cutCurveContext"; createCutCurveContext $tool; } } return scriptToolScript( "performCutCurve", $setToTool, $tool ); }