// =========================================================================== // 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 tool settings window for the softSelect tool. // global proc softSelectCurveKeyChanged(string $parent) { setParent $parent; if (`optionMenuGrp -q -exists softSelectCtrlFalloffInterpolation` && `gradientControlNoAttr -q -exists softSelectFalloffRamp`) { int $interp = `gradientControlNoAttr -q -currentKeyInterpValue softSelectFalloffRamp`; optionMenuGrp -e -select (1 + $interp) softSelectCtrlFalloffInterpolation; } } global proc softSelectColorKeyChanged(string $parent) { setParent $parent; if (`colorSliderGrp -q -exists softSelectColorRampSlider` && `gradientControlNoAttr -q -exists softSelectColorRamp`) { float $t[] = `gradientControlNoAttr -q -currentKeyColorValue softSelectColorRamp`; colorSliderGrp -e -rgb $t[0] $t[1] $t[2] softSelectColorRampSlider; } } global proc softSelectSetColorKey (string $parent) { setParent $parent; if (`colorSliderGrp -q -exists softSelectColorRampSlider` && `gradientControlNoAttr -q -exists softSelectColorRamp`) { float $t[] = `colorSliderGrp -q -rgb softSelectColorRampSlider`; gradientControlNoAttr -e -currentKeyColorValue $t[0] $t[1] $t[2] softSelectColorRamp; softSelect -e -softSelectColorCurve (`gradientControlNoAttr -q -asString softSelectColorRamp`); } } global proc setSoftSelectFalloffInterpolation( string $parent, string $method ) { setParent $parent; if (`optionMenuGrp -q -exists softSelectCtrlFalloffInterpolation` && `gradientControlNoAttr -q -exists softSelectFalloffRamp`) { int $interp = (`optionMenuGrp -q -select softSelectCtrlFalloffInterpolation` - 1); gradientControlNoAttr -e -currentKeyInterpValue $interp softSelectFalloffRamp; softSelect -e -softSelectCurve (`gradientControlNoAttr -q -asString softSelectFalloffRamp`); } } global proc setSoftSelectFalloffMode( string $method ) { global string $gSoftSelectFalloffModes[]; int $i = size( $gSoftSelectFalloffModes ); while( $i > 0 && $gSoftSelectFalloffModes[$i] != $method) $i--; softSelect -e -softSelectFalloff $i; } proc updateSoftSelectFalseColorEnable() // // Description: // Update the soft select mode. // { int $enabled = `softSelect -q -enableFalseColor` && `softSelect -q -softSelectEnabled`; text -e -enable $enabled softSelectColorText; gradientControlNoAttr -e -enable $enabled softSelectColorRamp; colorSliderGrp -e -enable $enabled softSelectColorRampSlider; } proc updateSoftSelectEnable() // // Description: // Update the soft select mode. // { int $enabled = `softSelect -q -softSelectEnabled`; text -e -enable $enabled softSelectFalloffText; text -e -enable $enabled softSelectFalloffPresetsText; gridLayout -e -enable $enabled softSelectProfilePresetsGrid; gradientControlNoAttr -e -enable $enabled softSelectFalloffRamp; optionMenuGrp -e -enable $enabled softSelectCtrlFalloffMode; optionMenuGrp -e -enable $enabled softSelectCtrlFalloffInterpolation; checkBoxGrp -e -enable $enabled softSelectEnableFalseColorChkBox; updateSoftSelectFalseColorEnable(); if( `floatSliderGrp -exists softSelectCtrlFloatUVRadius`) floatSliderGrp -e -enable $enabled softSelectCtrlFloatUVRadius; if( `floatSliderGrp -exists softSelectCtrlFloatRadius`) floatSliderGrp -e -enable $enabled softSelectCtrlFloatRadius; } // // Procedure Name: // setValues // // Description: // Configures the values in the softSelect tool box. // // Input Arguments: // Tool name. // Whether to set the options to default values. // // Return Value: // None. // proc setValues ( string $parent, int $forceFactorySettings ) { setParent $parent; // Enable/Disable // checkBoxGrp -e -value1 `softSelect -q -softSelectEnabled` -cc1 "softSelect -e -softSelectEnabled #1" softSelectEnableChkBox; optionMenuGrp -e -select (1 + `softSelect -q -softSelectFalloff`) -cc "setSoftSelectFalloffMode( \"#1\")" softSelectCtrlFalloffMode; if( `floatSliderGrp -exists softSelectCtrlFloatRadius`) { floatSliderGrp -e -value `softSelect -q -softSelectDistance` -cc ( "softSelect -e -softSelectDistance #1" ) softSelectCtrlFloatRadius; } if( `floatSliderGrp -exists softSelectCtrlFloatUVRadius`) { floatSliderGrp -e -value `softSelect -q -softSelectUVDistance` -cc ( "softSelect -e -softSelectUVDistance #1" ) softSelectCtrlFloatUVRadius; } gradientControlNoAttr -e -asString `softSelect -q -softSelectCurve` -changeCommand "softSelect -e -softSelectCurve \"#1\"" -currentKeyChanged ("softSelectCurveKeyChanged \"" + $parent + "\"") softSelectFalloffRamp; optionMenuGrp -e -changeCommand ("setSoftSelectFalloffInterpolation( \"" + $parent + "\", \"#1\")") softSelectCtrlFalloffInterpolation; // False colour // checkBoxGrp -e -value1 `softSelect -q -enableFalseColor` -cc1 "softSelect -e -enableFalseColor #1" softSelectEnableFalseColorChkBox; gradientControlNoAttr -e -asString `softSelect -q -softSelectColorCurve` -changeCommand "softSelect -e -softSelectColorCurve \"#1\"" -currentKeyChanged ("softSelectColorKeyChanged \"" + $parent + "\"") softSelectColorRamp; float $t[] = `gradientControlNoAttr -q -currentKeyColorValue softSelectColorRamp`; colorSliderGrp -e -changeCommand ("softSelectSetColorKey \"" + $parent + "\"") -rgb $t[0] $t[1] $t[2] softSelectColorRampSlider; updateSoftSelectEnable(); if (`about -linux`) { // Force a redraw on Linux evalDeferred( "gradientControlNoAttr -e -vis off softSelectFalloffRamp; gradientControlNoAttr -e -vis on softSelectFalloffRamp; "); evalDeferred( "gradientControlNoAttr -e -vis off softSelectColorRamp; gradientControlNoAttr -e -vis on softSelectColorRamp; "); } } // // Procedure Name: // softSelectValues // // Description: // Configures the values in the softSelect tool box. // // Input Arguments: // Tool name. // // Return Value: // None. // global proc softSelectValues ( string $parent ) { setValues( $parent, 0); } // // Procedure Name: // softSelectToolReset // // Description: // Resets the softSelect tool // // Input Arguments: // Tool name. // // Return Value: // None. // global proc softSelectToolReset( string $parent ) { setValues( $parent, 1); }