// =========================================================================== // 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 string $gReflectionPrevMode = "objectx"; global proc reflectionSetMode(string $mode) { global string $gReflectionPrevMode; int $symmetrizeSelection = true; if ($mode != "none") $gReflectionPrevMode = $mode; if ($mode == "none") { symmetricModelling -e -topoSymmetry 0 -symmetry 0; $symmetrizeSelection = false; } else if ($mode == "objectx") { symmetricModelling -e -about object -axis x -symmetry 1; } else if ($mode == "objecty") { symmetricModelling -e -about object -axis y -symmetry 1; } else if ($mode == "objectz") { symmetricModelling -e -about object -axis z -symmetry 1; } else if ($mode == "worldx") { symmetricModelling -e -about world -axis x -symmetry 1; } else if ($mode == "worldy") { symmetricModelling -e -about world -axis y -symmetry 1; } else if ($mode == "worldz") { symmetricModelling -e -about world -axis z -symmetry 1; } else if ($mode == "topo") { $symmetrizeSelection = false; if (dR_validSymmetrySelection()) { symmetricModelling -e -about topo -symmetry 1; } else { pickTopoSymmetryEdge("", 1); } } if ($symmetrizeSelection) { SymmetrizeSelection; } } global proc reflectionToggle() { global string $gReflectionPrevMode; reflectionSetMode(`symmetricModelling -q -symmetry` == 0 ? $gReflectionPrevMode : "none"); } global proc reflectionBuildMenu(string $menu) { menu -e -dai $menu; menuItem -label (uiRes("m_reflectionProperties.kSymOff")) -p $menu -c "reflectionSetMode none"; menuItem -label (uiRes("m_reflectionProperties.kSymObjectx")) -p $menu -c "reflectionSetMode objectx"; menuItem -label (uiRes("m_reflectionProperties.kSymObjecty")) -p $menu -c "reflectionSetMode objecty"; menuItem -label (uiRes("m_reflectionProperties.kSymObjectz")) -p $menu -c "reflectionSetMode objectz"; menuItem -label (uiRes("m_reflectionProperties.kSymWorldx")) -p $menu -c "reflectionSetMode worldx"; menuItem -label (uiRes("m_reflectionProperties.kSymWorldy")) -p $menu -c "reflectionSetMode worldy"; menuItem -label (uiRes("m_reflectionProperties.kSymWorldz")) -p $menu -c "reflectionSetMode worldz"; menuItem -label (uiRes("m_reflectionProperties.kSymTopology")) -p $menu -c "reflectionSetMode topo"; } global proc reflectionProperties(int $collapsed, int $uvTool) { setUITemplate -pushTemplate OptionsTemplate; frameLayout -collapsable true -collapse $collapsed -label (uiRes("m_reflectionProperties.kReflectionSettings")) CommonReflectionOptions_Fr; columnLayout CommonReflectionOptions_CL; // Symmetry mode rowLayout -nc 4 -cw4 132 20 157 48; text -align right -l (uiRes("m_reflectionProperties.kReflection")) -ann (uiRes("m_reflectionProperties.kReflectionModeAnnot")) CommonReflectionOptionsLabel; string $symButton = `iconTextButton -w 17 -h 26 -image ("popupMenuIcon.png") CommonReflectionOptionsButton`; string $symMenu = `popupMenu -b 1 -p $symButton`; menu -e -pmc ("reflectionBuildMenu " + $symMenu) $symMenu; string $symToggle = `popupMenu -b 2 -p $symButton`; menu -e -pmc "reflectionToggle" $symToggle; textField -ed false -width 157 -height 25 CommonReflectionOptionsText; button -label (uiRes("m_reflectionProperties.kReflectionBtn")) -command "ResetReflectionOptions" -width 48; setParent ..; if (!$uvTool) { floatSliderGrp -field true -label (uiRes("m_reflectionProperties.kTolerance")) -annotation (uiRes("m_reflectionProperties.kToleranceAnnot")) -precision 4 -min 0.0001 -max 0.2 -fieldMaxValue 1.0 CommonReflectionOptionsTol_FS; // Seam management checkBoxGrp -label (uiRes("m_reflectionProperties.kPreserveSeam")) -label1 "" -annotation (uiRes("m_reflectionProperties.kSeamHandlingAnnot")) CommonReflectionOptionsSeam_CB; floatSliderGrp -field true -label (uiRes("m_reflectionProperties.kSeamTolerance")) -annotation (uiRes("m_reflectionProperties.kSeamToleranceAnnot")) -precision 4 -min 0.0 -max 0.2 -fieldMaxValue 1000.0 CommonReflectionOptionsTol_ST; rowLayout -nc 2; text -label (uiRes("m_reflectionProperties.kFalloffCurve")) CommonReflectionOptionsSeam_FT; gradientControlNoAttr -h 90 CommonReflectionOptionsSeam_SF; setParent ..; // Topological symmetry options checkBoxGrp -label (uiRes("m_reflectionProperties.kAllowPartialSymmetry")) -label1 "" -annotation (uiRes("m_reflectionProperties.kAllowPartialSymmetryAnnot")) CommonReflectionOptionsAllowPartial_CB; } setParent ..; setParent ..; setUITemplate -popTemplate; }