// =========================================================================== // 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 polyCreateFacet context global proc callPolyCreateFacetCtx(string $toolName) { int $inval = `radioButtonGrp -query -select textureBox`; if($inval == 3) $inval = 0; eval("polyCreateFacetCtx -edit -tx " + $inval + " " + $toolName); } global proc changeMaxPointsValueCreate( string $toolName ) { int $useSlider = `checkBoxGrp -query -value1 limitPoints`; int $val = -1; if( $useSlider ){ $val = `intSliderGrp -query -value maxPointsSlider`; polyCreateFacetCtx -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("polyCreateFacetCtx -edit -maximumNumberOfPoints " + $val + " " + $toolName); } global proc polyCreateFacetValues ( string $toolName ) { string $name = "polyCreateFacet"; string $parent = (`toolPropertyWindow -query -location` + "|" + $name); setParent $parent; // Subdivisions // intFieldGrp -edit -value1 `polyCreateFacetCtx -query -subdivision $toolName` -changeCommand ("polyCreateFacetCtx -edit -subdivision #1 " +$toolName) subdSld; int $maxP = `polyCreateFacetCtx -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 ("changeMaxPointsValueCreate " + $toolName) limitPoints; // Max points intSliderGrp -edit -value $maxP -changeCommand ("changeMaxPointsValueCreate " + $toolName) maxPointsSlider; // Texture // int $val = `polyCreateFacetCtx -query -tx $toolName`; if($val == 0) $val = 3; radioButtonGrp -edit -select $val -changeCommand ("callPolyCreateFacetCtx " +$toolName) textureBox; // Planar constraint // checkBoxGrp -edit -value1 `polyCreateFacetCtx -query -planarConstraint $toolName` -onCommand1 togglePolyPlanarConstraints -offCommand1 togglePolyPlanarConstraints planarBox; string $helpTag= "CreatePolygonTool"; toolPropertySetCommon $toolName ($name + ".png") $helpTag; toolPropertySelect $name; }