// =========================================================================== // 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. // =========================================================================== // Procedure Name: // texSelConstUpdate // // Description: // Update selection constraint type selection of given text field // // Input Arguments: // $textField - textField to update. // // Return Value: // None. // global proc texSelConstUpdate( string $textField ) { if (`textField -q -ex $textField`) { //Not using global proc. Because this MIGHT be the first user float $defaultColor[] = {0.25098,0.25098,0.25098}; float $activeColor[] = {0.322,0.52,0.65}; textField -e -backgroundColor $activeColor[0] $activeColor[1] $activeColor[2] $textField; int $uvFaceOrientation[] = `polySelectConstraint -q -ufo`; if ($uvFaceOrientation[0] == 2) textField -edit -tx (uiRes("m_texSelConstUpdate.kBackFacing")) $textField; else if ($uvFaceOrientation[0] == 1) textField -edit -tx (uiRes("m_texSelConstUpdate.kFrontFacing")) $textField; else if ( `polySelectConstraint -uvc true -q -bo` ) textField -edit -tx (uiRes("m_texSelConstUpdate.kGeometryBorders")) $textField; else if ( `polySelectConstraint -q -ubs` ) textField -edit -tx (uiRes("m_texSelConstUpdate.kTextureBorders")) $textField; else if ( `polySelectConstraint -q -ulp -uvc` ) textField -edit -tx (uiRes("m_texSelConstUpdate.kUVEdgeLoop")) $textField; else if ( `polySelectConstraint -q -urp` ) textField -edit -tx (uiRes("m_texSelConstUpdate.kUVEdgeRing")) $textField; else if ( `polySelectConstraint -q -uv` ) textField -edit -tx (uiRes("m_texSelConstUpdate.kUVShell")) $textField; else { textField -edit -tx (uiRes("m_texSelConstUpdate.kFieldOff")) $textField; textField -e -backgroundColor $defaultColor[0] $defaultColor[1] $defaultColor[2] $textField; } } }