// =========================================================================== // 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: // insertCurveToolScript // // Description: // create wrapper around the insertCurve 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 insertCurveToolSetup( int $forceFactorySettings, string $goToTool ) { if( $forceFactorySettings || !`optionVar -ex insertCurveEuc` ) { optionVar -iv insertCurveEuc 0; } if( $forceFactorySettings || !`optionVar -ex insertCurveLac` ) { optionVar -iv insertCurveLac 1; } if( "" != $goToTool ) { scriptCtx -e -euc `optionVar -q insertCurveEuc` $goToTool; scriptCtx -e -lac `optionVar -q insertCurveLac` $goToTool; } } global proc insertCurveValues ( string $toolName ) { performInsertKnot 3 "Curve" $toolName; scriptCtxCommonValues( $toolName ); } global proc insertCurveProperties() { scriptCtxCommonProperties; } proc createInsertCurveContext( string $tool ) { if( ! `scriptCtx -exists $tool` ) { insertCurveToolSetup( 0, "" ); scriptCtx -i1 "insertKnot.png" -title (uiRes("m_insertCurveToolScript.kInsertKnotTool")) -bcn "insertCurve" -exitUponCompletion `optionVar -q insertCurveEuc` -totalSelectionSets 1 -expandSelectionList true -fcs ("insertCurveToolScript 0") -setNoSelectionPrompt (uiRes("m_insertCurveToolScript.kSelectPoints")) -setSelectionPrompt (uiRes("m_insertCurveToolScript.kSelectAdditionalPoints")) -setAutoToggleSelection true -setAutoComplete `optionVar -q insertCurveLac` -showManipulators true -setSelectionCount 0 -curveParameterPoint true -editPoint true $tool; } } global proc string performInsertKnotCrv( int $action, string $goToTool ) { return performInsertKnot( $action, "Curve", $goToTool ); } global proc string insertCurveToolScript( 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 modelWithToolInsertCurve` ) { $setToTool = 4 - $setToTool; } else { $tool = "insertCurveContext"; createInsertCurveContext $tool; } } return scriptToolScript( "performInsertKnotCrv", $setToTool, $tool ); }