// =========================================================================== // 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 createPolyTorusValues(string $toolName) { string $name = "createPolyTorus"; string $parent = (`toolPropertyWindow -q -location` + "|" + $name); setParent $parent; int $wDiv = `createPolyTorusCtx -q -sw $toolName`; int $hDiv = `createPolyTorusCtx -q -sh $toolName`; float $rad = `createPolyTorusCtx -q -radius $toolName`; float $srad = `createPolyTorusCtx -q -sectionRadius $toolName`; float $tw = `createPolyTorusCtx -q -twist $toolName`; int $uvSetting = `createPolyTorusCtx -q -createUVs $toolName`; int $createUV; if ($uvSetting == 1){ $createUV = 1; } else { $createUV = 0; } int $axis = `createPolyTorusCtx -q -axis $toolName`; int $dragEdit = `createPolyTorusCtx -q -doDragEdit $toolName`; intSliderGrp -e -v $wDiv -cc ("createPolyTorusCtx -e -sw #1 " + $toolName) createPolyTorusWidthDivisionsSlider; intSliderGrp -e -v $hDiv -cc ("createPolyTorusCtx -e -sh #1 " + $toolName) createPolyTorusHeightDivisionsSlider; floatSliderGrp -e -v $rad -cc ("createPolyTorusCtx -e -radius #1 " + $toolName) createPolyTorusRadiusSlider; radioButtonGrp -e -sl ($axis + 1) -onc ("changeTorusAxisSetting(\"" + $toolName+ "\")") createPolyTorusAxisRadioButton; floatSliderGrp -e -v $srad -cc ("createPolyTorusCtx -e -sectionRadius #1 " + $toolName) createPolyTorusSectionRadiusSlider; floatSliderGrp -e -v $tw -cc ("createPolyTorusCtx -e -twist #1 " + $toolName) createPolyTorusTwistSlider; checkBoxGrp -e -v1 $createUV -cc1 ("changeTorusUVSettings(\"" + $toolName+ "\")") createPolyTorusCreateUVCheckBox; checkBoxGrp -e -v1 $dragEdit -cc1 ("createPolyTorusCtx -e -doDragEdit " + !$dragEdit + " " + $toolName) createPolyTorusDragEditCheckBox; string $icon = "polyTorus.png"; string $helpTag= "CreatePolyTorusTool"; toolPropertySetCommon $toolName $icon $helpTag; toolPropertySelect $name; changeTorusUVSettings($toolName); } global proc changeTorusAxisSetting(string $toolName){ int $axisSetting = 0; if (`radioButtonGrp -exists createPolyTorusAxisRadioButton`){ $axisSetting = (`radioButtonGrp -q -sl createPolyTorusAxisRadioButton` - 1); } if ($axisSetting < 0){ $axisSetting = 0; } string $cmd = "createPolyTorusCtx -e -axis " + $axisSetting + " " + $toolName; eval($cmd); } global proc changeTorusUVSettings(string $toolName) { int $value = 0; int $createUVVal; if (`checkBoxGrp -exists createPolyTorusCreateUVCheckBox`){ $createUVVal = `checkBoxGrp -q -v1 createPolyTorusCreateUVCheckBox`; } $value = $createUVVal; string $cmd = ("createPolyTorusCtx -edit -cuv " + $value + " " + $toolName); eval($cmd); }