// =========================================================================== // 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 select options that are common to the // main selection tools. // // // Procedure Name: // commonSelectProperties // // Description: // Creates the UI for configuring the softSelect options. // // Input Arguments: // // Return Value: // None. // global proc commonSelectProperties(int $collapsed, int $uvTool) { setUITemplate -pushTemplate OptionsTemplate; frameLayout -collapsable true -collapse $collapsed -label (uiRes("m_commonSelectProperties.kCommonSelection")) ; columnLayout; string $marqueeStyle = (uiRes("m_commonSelectProperties.kMarqueeStyle")); string $dragStyle = (uiRes("m_commonSelectProperties.kSelectStyle")); radioButtonGrp -nrb 1 -cw3 131 126 124 -label (uiRes("m_commonSelectProperties.kStyle")) -label1 $marqueeStyle -annotation (uiRes("m_commonSelectProperties.kSelectionStyleMarqueeAnnot")) -onCommand1 ("selectPref -paintSelect 0") SelectionStyleRB1; if (!$uvTool) { checkBoxGrp -columnWidth 1 150 -label1 (uiRes("m_commonSelectProperties.kCameraBasedSelection")) -annotation (uiRes("m_commonSelectProperties.kCameraBasedSelectionAnnot")) -changeCommand ("selectPref -useDepth #1") CameraBasedSelectionChkBox; } radioButtonGrp -nrb 1 -cw3 131 126 124 -label1 $dragStyle -annotation (uiRes("m_commonSelectProperties.kSelectionStyleDragAnnot")) -onCommand1 ("selectPref -paintSelect 1") -shareCollection SelectionStyleRB1 SelectionStyleRB2; if (!$uvTool) { checkBoxGrp -columnWidth 1 150 -label1 (uiRes("m_commonSelectProperties.kCameraBasedPaintSelection")) -annotation (uiRes("m_commonSelectProperties.kCameraBasedPaintSelectionAnnot")) -changeCommand ("selectPref -paintSelectWithDepth #1") CameraBasedPaintSelectionChkBox; checkBoxGrp -label1 (uiRes("m_commonSelectProperties.kAutoCameraBasedSelection")) -annotation (uiRes("m_commonSelectProperties.kAutoCameraBasedSelectionAnnot")) -changeCommand ("selectPref -autoUseDepth #1") AutoCameraBasedSelectionChkBox; } checkBoxGrp -label1 (uiRes("m_commonSelectProperties.kPreSelectHighlightBackfaces")) -annotation (uiRes("m_commonSelectProperties.kPreSelectHighlightBackfacesAnnot")) -changeCommand ("selectPref -preSelectBackfacing #1") PreSelectBackfacesChkBox; checkBoxGrp -label1 (uiRes("m_commonSelectProperties.kPreSelectClosestComponent")) -annotation (uiRes("m_commonSelectProperties.kPreSelectClosestComponentAnnot")) -changeCommand ("selectPref -preSelectClosest #1") PreSelectClosestChkBox; checkBoxGrp -label1 (uiRes("m_commonSelectProperties.kHighlightAffectedChkBox")) -annotation (uiRes("m_commonSelectProperties.kHighlightAffectedAnnot")) -changeCommand ("displayPref -displayAffected #1;") HighlightAffectedChkBox; if ($uvTool) { rowLayout -nc 3 -cw3 132 20 157; string $texSelCnsLabel = `text -align right -l (uiRes("m_commonSelectProperties.kSelCnsLable")) texselConstLabel`; string $texSelCnsButton = `iconTextButton -dcc "" -w 17 -h 25 -image("popupMenuIcon.png") texSelConstPopupButton`; textField -ed false -w 65 -h 25 -ebg 0 -tx (uiRes("m_commonSelectProperties.kOff")) texSelConstTextField; string $menu = `popupMenu -b 1 -p $texSelCnsButton`; menu -e -pmc("buildTexSelConstMenu " + $menu) $menu; string $menu2 = `popupMenu -b 2 -p $texSelCnsButton`; menu -e -pmc "texSelConstToggle" $menu2; setParent ..; } else { rowLayout -nc 4 -cw4 132 20 95 78; string $selCnsLabel = `text -align right -l (uiRes("m_commonSelectProperties.kSelCnsLable")) selConstLabel`; string $selCnsButton = `iconTextButton -dcc "" -w 17 -h 25 -image("popupMenuIcon.png") selConstPopupButton`; textField -ed false -w 65 -h 25 -ebg 0 -tx (uiRes("m_commonSelectProperties.kOff")) -ann (uiRes("m_commonSelectProperties.kSetSelectionConstraintType")) selConstTextField; string $menu = `popupMenu -b 1 -p $selCnsButton`; menu -e -pmc("dR_buildSelConstMenu " + $menu) $menu; string $menu2 = `popupMenu -b 2 -p $selCnsButton`; menu -e -pmc "dR_toggleSelConst" $menu2; float $angleVal = `polySelectConstraint -q -at`; floatField -pre 0 -min 0 -max 180 -w 25 -h 26 -step 1 -cc "dR_setSelConstAngle #1" -v $angleVal -ann(uiRes("m_commonSelectProperties.kSetSelectionConstraintType")) selConstField; setParent ..; } setParent ..; setParent ..; setUITemplate -popTemplate; } global proc updateSelConstField() { if (`textField -exists selConstTextField`) { global float $gActiveControlColor[]; global float $gDefaultFieldBgColor[]; textField -e -backgroundColor $gActiveControlColor[0] $gActiveControlColor[1] $gActiveControlColor[2] selConstTextField; if (`polySelectConstraint -q -bp`) textField -edit -tx (uiRes("m_commonSelectProperties.kBorder")) selConstTextField; else if (`polySelectConstraint -q -ap`) textField -edit -tx (uiRes("m_commonSelectProperties.kAngle")) selConstTextField; else if (`polySelectConstraint -q -sh`) textField -edit -tx (uiRes("m_commonSelectProperties.kShell")) selConstTextField; else if (`polySelectConstraint -q -lp`) textField -edit -tx (uiRes("m_commonSelectProperties.kEdgeLoop")) selConstTextField; else if (`polySelectConstraint -q -rp`) textField -edit -tx (uiRes("m_commonSelectProperties.kEdgeRing")) selConstTextField; else if (`polySelectConstraint -q -ulp`) textField -edit -tx (uiRes("m_commonSelectProperties.kUVEdgeLoop")) selConstTextField; else { textField -edit -tx (uiRes("m_commonSelectProperties.kFieldOff")) selConstTextField; textField -e -backgroundColor $gDefaultFieldBgColor[0] $gDefaultFieldBgColor[1] $gDefaultFieldBgColor[2] selConstTextField; } } if (`control -exists selConstField`) { if (`polySelectConstraint -q -ap`) control -e -en true selConstField; else control -e -en false selConstField; } }