// =========================================================================== // 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 createPolyPipeValues(string $toolName) { string $name = "createPolyPipe"; string $parent = (`toolPropertyWindow -q -location` + "|" + $name); setParent $parent; int $aDiv = `createPolyPipeCtx -q -sa $toolName`; int $hDiv = `createPolyPipeCtx -q -sh $toolName`; int $cDiv = `createPolyPipeCtx -q -sc $toolName`; int $roundCap = `createPolyPipeCtx -q -roundCap $toolName`; float $rad = `createPolyPipeCtx -q -radius $toolName`; float $h = `createPolyPipeCtx -q -height $toolName`; float $th = `createPolyPipeCtx -q -thickness $toolName`; int $uvSetting = `createPolyPipeCtx -q -createUVs $toolName`; int $createUV; if ($uvSetting == 1){ $createUV = 1; } else { $createUV = 0; } int $axis = `createPolyPipeCtx -q -axis $toolName`; int $dragEdit = `createPolyPipeCtx -q -doDragEdit $toolName`; int $dragEditCaps = `createPolyPipeCtx -q -doSubdivisionsCapsEdit $toolName`; intSliderGrp -e -v $aDiv -cc ("createPolyPipeCtx -e -sa #1 " + $toolName) createPolyPipeAxisDivisionsSlider; intSliderGrp -e -v $hDiv -cc ("createPolyPipeCtx -e -sh #1 " + $toolName) createPolyPipeHeightDivisionsSlider; intSliderGrp -e -v $cDiv -cc ("createPolyPipeCtx -e -sc #1 " + $toolName) createPolyPipeCapDivisionsSlider; checkBoxGrp -e -v1 $roundCap -cc1 ( "createPolyPipeCtx -e -roundCap #1 " + $toolName + ";" + "if(#1 && `createPolyPipeCtx -query -subdivisionsCap " + $toolName + "` < 2)" + "{ createPolyPipeCtx -edit -subdivisionsCap 2 " + $toolName + ";}") createPolyPipeRoundCapCheckBox; floatSliderGrp -e -v $rad -cc ("createPolyPipeCtx -e -radius #1 " + $toolName) createPolyPipeRadiusSlider; floatSliderGrp -e -v $h -cc ("createPolyPipeCtx -e -height #1 " + $toolName) createPolyPipeHeightSlider; floatSliderGrp -e -v $th -cc ("createPolyPipeCtx -e -thickness #1 " + $toolName) createPolyPipeThicknessSlider; radioButtonGrp -e -sl ($axis + 1) -cc ("changePipeAxisSetting(\"" + $toolName+ "\")") createPolyPipeAxisRadioButton; checkBoxGrp -e -v1 $createUV -cc1 ("changePipeUVSettings(\"" + $toolName+ "\")") createPolyPipeCreateUVCheckBox; checkBoxGrp -e -v1 $dragEdit -cc1 ("createPolyPipeCtx -e -doDragEdit " + !$dragEdit + " " + $toolName) createPolyPipeDragEditCheckBox; int $doDrag = `checkBoxGrp -q -v1 createPolyPipeDragEditCheckBox`; if ($doDrag) checkBoxGrp -edit -enable true createPolyPipeCapsDragEditCheckBox; else checkBoxGrp -edit -enable false createPolyPipeCapsDragEditCheckBox; checkBoxGrp -e -v1 $dragEditCaps -cc1 ("createPolyPipeCtx -e -doSubdivisionsCapsEdit " + !$dragEditCaps + " " + $toolName) createPolyPipeCapsDragEditCheckBox; string $icon = "polyPipe.png"; string $helpTag= "CreatePolyPipeTool"; toolPropertySetCommon $toolName $icon $helpTag; toolPropertySelect $name; changePipeUVSettings($toolName); } global proc changePipeAxisSetting(string $toolName){ int $axisSetting = 0; if (`radioButtonGrp -exists createPolyPipeAxisRadioButton`){ $axisSetting = (`radioButtonGrp -q -sl createPolyPipeAxisRadioButton` - 1); } if ($axisSetting < 0){ $axisSetting = 0; } string $cmd = "createPolyPipeCtx -e -axis " + $axisSetting + " " + $toolName; eval($cmd); } global proc changePipeUVSettings(string $toolName) { int $value = 0; int $createUVVal; if (`checkBoxGrp -exists createPolyPipeCreateUVCheckBox`){ $createUVVal = `checkBoxGrp -q -v1 createPolyPipeCreateUVCheckBox`; } $value = $createUVVal; string $cmd = ("createPolyPipeCtx -edit -cuv " + $value + " " + $toolName); eval($cmd); }