// =========================================================================== // 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: November 25, 1996 // // Description: // This script configures the option box dialog for the softMod tool. // // // Procedure Name: // setSoftModFalloffMode // // Description: // Configures the falloff method // // Return Value: // None. // global proc setSoftModFalloffMode( string $method ) { global string $gSoftModFalloffModes[]; int $i = size( $gSoftModFalloffModes ); while( $i > 0 && $gSoftModFalloffModes[$i] != $method) $i--; optionVar -intValue softModFalloffMode $i; } // // Procedure Name: // softModColorFeedback // // Description: // Enable/Disable color softmod feedback // // Return Value: // None. // global proc softModColorFeedback( int $enable ) { string $ctx = `currentCtx`; if( `contextInfo -c $ctx` != "softMod" ) $ctx = "softModContext"; softModCtx -e -falseColor $enable $ctx; } // // Procedure Name: // setValues // // Description: // Configures the values in the softMod tool box. // // Input Arguments: // Tool name. // Whether to set the options to default values. // // Return Value: // None. // proc setValues ( string $toolName, int $forceFactorySettings ) { string $parent = (`toolPropertyWindow -q -location` + "|softMod"); setParent $parent; // Initialize settings // if( !`exists setSoftModOptionVars`) { source "performSoftMod.mel"; } setSoftModOptionVars( $forceFactorySettings ); // Force the ramp widget to pick up the latest value of the // curve (in case it has been edited in the option box say) // string $tmp[] = `optionVar -q softModFalloffCurveOptionVar`; gradientControlNoAttr -e -optionVar "" softModFalloffRamp; optionVar -rm softModFalloffCurveOptionVar; int $i = 0; while( $i < size( $tmp )) { optionVar -stringValueAppend softModFalloffCurveOptionVar $tmp[$i]; $i = $i + 1; } floatSliderGrp -e -enable 1 -value `optionVar -q softModFalloffRadius` softModCtrlFloatRadius; int $falloffModeIdx = `optionVar -q softModFalloffMode`; global string $gSoftModFalloffModes[]; optionMenuGrp -e -value $gSoftModFalloffModes[$falloffModeIdx] -cc "setSoftModFalloffMode( \"#1\")" softModCtrlFalloffMode; checkBoxGrp -e -value1 `optionVar -q softModFalloffInX` -value2 `optionVar -q softModFalloffInY` -value3 `optionVar -q softModFalloffInZ` softModCtrlFalloffIn; checkBoxGrp -e -value1 `optionVar -q softModColorFeedback` -cc1 "optionVar -intValue softModColorFeedback #1; softModColorFeedback #1" softModColorFeedback; checkBoxGrp -e -value1 `optionVar -q softModPreserveHistory` -cc1 "optionVar -intValue softModPreserveHistory #1" softModCtrlPreserveHistory; checkBoxGrp -e -value1 `optionVar -q softModFalloffMasking` -cc1 "optionVar -intValue softModFalloffMasking #1" softModCtrlFalloffMasking; checkBoxGrp -e -value1 `optionVar -q softModFalloffAroundSelection` -cc1 "optionVar -intValue softModFalloffAroundSelection #1" softModCtrlFalloffAroundSelection; floatSliderGrp -e -cc ( "optionVar -floatValue softModFalloffRadius #1" ) softModCtrlFloatRadius; gradientControlNoAttr -e -optionVar "softModFalloffCurveOptionVar" softModFalloffRamp; checkBoxGrp -e -of1 "optionVar -intValue softModFalloffInX 0" -on1 "optionVar -intValue softModFalloffInX 1" -of2 "optionVar -intValue softModFalloffInY 0" -on2 "optionVar -intValue softModFalloffInY 1" -of3 "optionVar -intValue softModFalloffInZ 0" -on3 "optionVar -intValue softModFalloffInZ 1" softModCtrlFalloffIn; string $helpTag = "softModificationTool"; toolPropertySetCommon $toolName "softMod.png" $helpTag; toolPropertySelect "softMod"; if (`about -linux`) { // Force a redraw on Linux evalDeferred( "gradientControlNoAttr -e -vis off softModFalloffRamp; gradientControlNoAttr -e -vis on softModFalloffRamp; "); } } // // Procedure Name: // softModValues // // Description: // Configures the values in the softMod tool box. // // Input Arguments: // Tool name. // // Return Value: // None. // global proc softModValues ( string $toolName ) { setValues( $toolName, 0); } // // Procedure Name: // softModToolReset // // Description: // Resets the softMod tool // // Input Arguments: // Tool name. // // Return Value: // None. // global proc softModToolReset () { string $ctx = `currentCtx`; if( `contextInfo -c $ctx` == "softMod") setValues( $ctx, 1); }