// =========================================================================== // 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. // =========================================================================== // // this proc points the tool properties // window to the current polyAppend context global proc callPolyAppendFacetCtx(string $toolName) { int $inval = `radioButtonGrp -query -select textureBox`; if($inval == 3) $inval = 0; eval("polyAppendFacetCtx -edit -tx " + $inval + " " + $toolName); } global proc changeMaxPointsValueAppend( string $toolName ) { int $useSlider = `checkBoxGrp -query -value1 limitPoints`; int $val = -1; if( $useSlider ){ $val = `intSliderGrp -query -value maxPointsSlider`; polyAppendFacetCtx -edit -subdivision 1 $toolName; intFieldGrp -edit -value1 1 subdSld; disable -value false maxPointsSlider; disable -value true subdSld; } else { intSliderGrp -edit -value -1 maxPointsSlider; disable -value true maxPointsSlider; disable -value false subdSld; } eval("polyAppendFacetCtx -edit -maximumNumberOfPoints " + $val + " " + $toolName); } global proc polyAppendValues ( string $toolName ) { string $name = "polyAppend"; string $parent = (`toolPropertyWindow -query -location` + "|" + $name); setParent $parent; // Subdivisions // intFieldGrp -e -value1 `polyAppendFacetCtx -query -subdivision $toolName` -changeCommand ("polyAppendFacetCtx -edit -subdivision #1 " +$toolName) subdSld; int $maxP = `polyAppendFacetCtx -query -maximumNumberOfPoints $toolName`; int $limitPoints; if( $maxP < 3 ){ $limitPoints = 0; $maxP = 4; disable -value false subdSld; disable -value true maxPointsSlider; } else { $limitPoints = 1; disable -value true subdSld; disable -value false maxPointsSlider; } checkBoxGrp -edit -value1 $limitPoints -changeCommand ("changeMaxPointsValueAppend " + $toolName) limitPoints; // Max points intSliderGrp -edit -value $maxP -changeCommand ("changeMaxPointsValueAppend " + $toolName) maxPointsSlider; // Texture // // checkBox -e int $val = `polyAppendFacetCtx -query -tx $toolName`; if($val == 0) $val = 3; radioButtonGrp -edit -select $val -changeCommand ("callPolyAppendFacetCtx " +$toolName) textureBox; // Rotation // floatSliderGrp -edit -enable `polyAppendFacetCtx -query -isRotateAvailable $toolName` -value `polyAppendFacetCtx -query -rotate $toolName` -changeCommand ("polyAppendFacetCtx -edit -rotate #1 " +$toolName) -dragCommand ("polyAppendFacetCtx -edit -rotate #1 " +$toolName) angSld; // Planar constraint // checkBoxGrp -edit -value1 `polyAppendFacetCtx -query -planarConstraint $toolName` -onCommand1 togglePolyPlanarConstraints -offCommand1 togglePolyPlanarConstraints planarBox; string $helpTag= "AppendtoPolygonTool"; toolPropertySetCommon $toolName "polyAppendFacet.png" $helpTag; toolPropertySelect $name; }