// =========================================================================== // 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 provides a UI for the softSelect options. // // // Procedure Name: // softSelectProperties // // Description: // Creates the UI for configuring the softSelect options. // // Input Arguments: // // Return Value: // None. // global proc storeSoftSelectCustomCurve() { string $curveValue = `softSelect -q -softSelectCurve`; optionVar -stringValue "SoftSelectCustomFalloffCurve" $curveValue; } global proc softSelectCustomCurveCB() { if (`optionVar -exists "SoftSelectCustomFalloffCurve"`) { string $curveValue = `optionVar -q "SoftSelectCustomFalloffCurve"`; if ("" != $curveValue) { softSelect -e -softSelectCurve $curveValue; } } } global proc softSelectProperties(int $collapsed, int $uvToolProperties) { global string $gSoftSelectFalloffModes[]; if( size( $gSoftSelectFalloffModes ) == 0 ) { // These menu options MUST be in the same order as the enumerated // values defined for TDNsoftSelect::aFalloffMode // Note that we're sharing resource strings with softMOD, even though this is soft SELECT $gSoftSelectFalloffModes = { uiRes("n_softMod.a_fom_enum_kVolumeFalloff"), uiRes("n_softMod.a_fom_enum_kSurfaceFalloff"), (uiRes("m_softSelectProperties.kGlobalFalloff")), (uiRes("m_softSelectProperties.kObjectFalloff")) }; } global string $gSoftSelectFalloffPresets[]; if( size( $gSoftSelectFalloffPresets ) == 0 ) { $gSoftSelectFalloffPresets = { "softSelect -e -softSelectCurve \"1,0,2,0,1,2\"", "softSelect -e -softSelectCurve \"1,0.5,2,0,1,2,1,0,2\"", "softSelect -e -softSelectCurve \"0,1,0,1,0,1,0,1,1\"", "softSelect -e -softSelectCurve \"1,0,0,0,1,2\"", "softSelect -e -softSelectCurve \"0,0,2,1,0.8,2,0,1,2\"", "softSelect -e -softSelectCurve \"1,0,2,0,0.16,2,0.75,0.32,2,0,0.48,2,0.25,0.64,2,0,0.8,2,0,1,2\"", "softSelect -e -softSelectCurve \"1,0,1,0.75,0.25,1,0.5,0.5,1,0.75,0.25,1,0.25,0.75,1,1,0.249,1,0.749,0.499,1,0.499,0.749,1\"", "softSelect -e -softSelectCurve \"0,0.25,2,1,0.5,2,0,0.75,2\"", "softSelect -e -softSelectCurve \"1,0,2,0,0.16,2,1,0.32,2,0,0.48,2,1,0.64,2,0,0.8,2,0,1,2\"" }; } // Linux Motif2.1 shrinks the checkBox, if the string is "" // NT would tab over the blank (" ") string label. // So... string $emptyLabel = ""; if (`about -linux`) { $emptyLabel = " "; } frameLayout -collapsable true -collapse $collapsed -label (uiRes("m_softSelectProperties.kSoftSelection")) ; columnLayout softSelectCtrlOptions; rowLayout -nc 2 -cw2 275 35 -columnAttach 1 "left" 0 -columnAttach 2 "right" 0; checkBoxGrp -label (uiRes("m_softSelectProperties.kSoftSelectEnabled")) -label1 "" -annotation (uiRes("m_softSelectProperties.kEnableSoftSelectAnnot")) -width 150 softSelectEnableChkBox; button -label (uiRes("m_softSelectProperties.kResetSoftSelectBtn")) -command "ResetSoftSelectOptions" -width 48; setParent ..; optionMenuGrp -label (uiRes("m_softSelectProperties.kFalloffMode")) softSelectCtrlFalloffMode; int $i; global string $gSoftSelectFalloffModes[]; for( $i = 0; $i < size( $gSoftSelectFalloffModes ); $i++) menuItem -label $gSoftSelectFalloffModes[ $i]; if (!$uvToolProperties) { floatSliderGrp -field true -pre 2 -min 0 -max 100 -fieldMaxValue 100000 -label (uiRes("m_softSelectProperties.kFalloffRadius")) -value 5.0 softSelectCtrlFloatRadius; } else { floatSliderGrp -field true -pre 2 -min 0 -max 1 -fieldMaxValue 500 -label (uiRes("m_softSelectProperties.kUVFalloffRadius")) -value 0.5 softSelectCtrlFloatUVRadius; } rowLayout -nc 2; text -label (uiRes("m_softSelectProperties.kFalloffCurve")) softSelectFalloffText; gradientControlNoAttr -h 90 softSelectFalloffRamp; setParent ..; optionMenuGrp -label (uiRes("m_softSelectProperties.kCurveInterpolation")) softSelectCtrlFalloffInterpolation; menuItem -label (uiRes("m_softSelectProperties.kNone")); menuItem -label (uiRes("m_softSelectProperties.kLinear")); menuItem -label (uiRes("m_softSelectProperties.kSmooth")); menuItem -label (uiRes("m_softSelectProperties.kSpline")); rowLayout -nc 2 -cw 2 230; int $presetCellSize = 23; text -label (uiRes("m_softSelectProperties.kFalloffCurvePresets")) softSelectFalloffPresetsText; global string $gSoftSelectFalloffPresets[]; gridLayout -numberOfColumns 10 -cellWidthHeight $presetCellSize $presetCellSize softSelectProfilePresetsGrid; iconTextButton -image "softCurveProfile.png" -command $gSoftSelectFalloffPresets[0]; iconTextButton -image "mediumCurveProfile.png" -command $gSoftSelectFalloffPresets[1]; iconTextButton -image "linearCurveProfile.png" -command $gSoftSelectFalloffPresets[2]; iconTextButton -image "hardCurveProfile.png" -command $gSoftSelectFalloffPresets[3]; iconTextButton -image "craterCurveProfile.png" -command $gSoftSelectFalloffPresets[4]; iconTextButton -image "waveCurveProfile.png" -command $gSoftSelectFalloffPresets[5]; iconTextButton -image "stairsCurveProfile.png" -command $gSoftSelectFalloffPresets[6]; iconTextButton -image "ringCurveProfile.png" -command $gSoftSelectFalloffPresets[7]; iconTextButton -image "sineCurveProfile.png" -command $gSoftSelectFalloffPresets[8]; string $customButton = `iconTextButton -image "customSoftSelectFalloffCurve.png" -command "softSelectCustomCurveCB"`; setParent ..; setParent ..; separator; checkBoxGrp -label (uiRes("m_softSelectProperties.kSoftSelectColourEnabled")) -label1 "" -annotation (uiRes("m_softSelectProperties.kEnableSoftSelectFalseColorAnnot")) softSelectEnableFalseColorChkBox; rowLayout -nc 2; text -label (uiRes("m_softSelectProperties.kColorCurve")) softSelectColorText; gradientControlNoAttr -h 90 -rampAsColor true softSelectColorRamp; setParent ..; colorSliderGrp -label (uiRes("m_softSelectProperties.kColorSlider")) softSelectColorRampSlider; setParent ..; setParent ..; popupMenu -parent $customButton; menuItem -label (uiRes("m_softSelectProperties.kSoftSelectCustomCurve")) -command "storeSoftSelectCustomCurve"; }