// =========================================================================== // 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. // =========================================================================== global proc createPolyPlaneValues(string $toolName) { string $name = "createPolyPlane"; string $parent = (`toolPropertyWindow -q -location` + "|" + $name); setParent $parent; int $wDiv = `createPolyPlaneCtx -q -sw $toolName`; int $dDiv = `createPolyPlaneCtx -q -sh $toolName`; float $w = `createPolyPlaneCtx -q -width $toolName`; float $h = `createPolyPlaneCtx -q -height $toolName`; int $uvSetting = `createPolyPlaneCtx -q -createUVs $toolName`; int $createUV = 0; int $preserveAR = 0; if ($uvSetting == 2){ $createUV = 1; $preserveAR = 1; } else if ($uvSetting == 1){ $createUV = 1; } int $axis = `createPolyPlaneCtx -q -axis $toolName`; int $dragEdit = `createPolyPlaneCtx -q -doDragEdit $toolName`; intSliderGrp -e -v $wDiv -cc ("createPolyPlaneCtx -e -sw #1 " + $toolName) createPolyPlaneWidthDivisionsSlider; intSliderGrp -e -v $dDiv -cc ("createPolyPlaneCtx -e -sh #1 " + $toolName) createPolyPlaneHeightDivisionsSlider; floatSliderGrp -e -v $w -cc ("createPolyPlaneCtx -e -width #1 " + $toolName) createPolyPlaneWidthSlider; floatSliderGrp -e -v $h -cc ("createPolyPlaneCtx -e -height #1 " + $toolName) createPolyPlaneHeightSlider; radioButtonGrp -e -sl ($axis + 1) -cc ("changePlaneAxisSetting(\"" + $toolName+ "\")") createPolyPlaneAxisRadioButton; checkBoxGrp -e -v1 $createUV -cc1 ("changePlaneUVSettings(\"" + $toolName+ "\")") createPolyPlaneCreateUVCheckBox; checkBoxGrp -e -v1 $preserveAR -cc1 ("changePlaneUVSettings(\"" + $toolName+ "\")") createPolyPlanePreserveAspectRatioCheckBox; checkBoxGrp -e -v1 $dragEdit -cc1 ("createPolyPlaneCtx -e -doDragEdit " + !$dragEdit + " " + $toolName) createPolyPlaneDragEditCheckBox; string $icon = "polyPlane.png"; string $helpTag= "CreatePolyPlaneTool"; toolPropertySetCommon $toolName $icon $helpTag; toolPropertySelect $name; changePlaneUVSettings($toolName); } global proc changePlaneAxisSetting(string $toolName){ int $axisSetting = 0; if (`radioButtonGrp -exists createPolyPlaneAxisRadioButton`){ $axisSetting = (`radioButtonGrp -q -sl createPolyPlaneAxisRadioButton` - 1); } if ($axisSetting < 0){ $axisSetting = 0; } string $cmd = "createPolyPlaneCtx -e -axis " + $axisSetting + " " + $toolName; eval($cmd); } global proc changePlaneUVSettings(string $toolName) { int $value = 0; int $createUVVal; int $preserveARVal; if (`checkBoxGrp -exists createPolyPlaneCreateUVCheckBox`){ $createUVVal = `checkBoxGrp -q -v1 createPolyPlaneCreateUVCheckBox`; } if (`checkBoxGrp -exists createPolyPlanePreserveAspectRatioCheckBox`){ $preserveARVal = `checkBoxGrp -q -v1 createPolyPlanePreserveAspectRatioCheckBox`; } if ($createUVVal){ checkBoxGrp -edit -enable true createPolyPlanePreserveAspectRatioCheckBox; }else { checkBoxGrp -edit -enable false createPolyPlanePreserveAspectRatioCheckBox; } if($createUVVal && $preserveARVal){ $value = 2; } else if ($createUVVal){ $value = 1; } string $cmd = ("createPolyPlaneCtx -edit -cuv " + $value + " " + $toolName); eval($cmd); }