// =========================================================================== // 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 int reflectionIsSupported() { // Symmetry is currently not supported when using global or object soft select return (!`softSelect -q -softSelectEnabled` || `softSelect -q -softSelectFalloff` < 2); } global proc string reflectionGetModeString() { int $symOn = `symmetricModelling -q -symmetry`; if ($symOn) { string $sym = `symmetricModelling -q -about`; if ($sym == "object") { return uiRes("m_reflectionProperties.kSymObject" + `symmetricModelling -q -axis`); } else if ($sym == "world") { return uiRes("m_reflectionProperties.kSymWorld" + `symmetricModelling -q -axis`); } else if ($sym == "topo") { string $object = `symmetricModelling -q -topoSymmetry`; if ($object != "") { string $transforms[] = listTransforms($object); return $transforms[0]; } } } return uiRes("m_reflectionProperties.kSymOff"); } global proc reflectionValues ( ) { string $parent = `setParent -q`; // Check whether symmetry is supported based on the current tool/settings int $allow = reflectionIsSupported(); // Symmetry Mode. iconTextButton -e -en $allow CommonReflectionOptionsButton; textField -e -tx `reflectionGetModeString` CommonReflectionOptionsText; // Symmetry Tolerance. if(`floatSliderGrp -q -ex CommonReflectionOptionsTol_FS`) floatSliderGrp -edit -enable $allow -value `symmetricModelling -q -tolerance` -cc ("symmetricModelling -e -tolerance #1") CommonReflectionOptionsTol_FS; // Symmetry seam if(`checkBoxGrp -q -ex CommonReflectionOptionsSeam_CB`) checkBoxGrp -edit -enable $allow -value1 `symmetricModelling -q -preserveSeam` -cc1 "symmetricModelling -e -preserveSeam #1" CommonReflectionOptionsSeam_CB; int $seamEnabled = ($allow && `symmetricModelling -q -preserveSeam`); // Seam Tolerance. if(`floatSliderGrp -q -ex CommonReflectionOptionsTol_ST`) floatSliderGrp -edit -enable $seamEnabled -value `symmetricModelling -q -seamTolerance` -cc ("symmetricModelling -e -seamTolerance #1") CommonReflectionOptionsTol_ST; // Seam falloff curve if(`gradientControlNoAttr -q -ex CommonReflectionOptionsSeam_SF`) gradientControlNoAttr -e -enable $seamEnabled -asString `symmetricModelling -q -seamFalloffCurve` -cc "symmetricModelling -e -seamFalloffCurve \"#1\"" CommonReflectionOptionsSeam_SF; if(`text -q -ex CommonReflectionOptionsSeam_FT`) text -e -enable $seamEnabled CommonReflectionOptionsSeam_FT; // Topological symmetry options if(`checkBoxGrp -q -ex CommonReflectionOptionsAllowPartial_CB`) checkBoxGrp -edit -enable $allow -value1 `symmetricModelling -q -allowPartial` -cc1 "symmetricModelling -e -allowPartial #1" CommonReflectionOptionsAllowPartial_CB; }