// =========================================================================== // 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. // =========================================================================== // // // Creation Date: April 22, 1997 // // Description: // Display -> Custom Polygon Setup item // // Input Arguments: // int if 1 show option box // if 0 perform command with current values // if 2 returns the default settings as a command string // Return Value: // none // proc setOptionVars (int $forceFactorySettings) { // Objects Afftected // if ($forceFactorySettings || !`optionVar -exists displayPolyObjsAffected`) optionVar -intValue displayPolyObjsAffected 0; // Vertices Display if ($forceFactorySettings || !`optionVar -exists displayPolyVtxDisp`) { optionVar -clearArray displayPolyVtxDisp; optionVar -intValue displayPolyVtxDisp 0 -intValueAppend displayPolyVtxDisp 0; } // Vertex Size // if ($forceFactorySettings || !`optionVar -exists displayPolyVertexSize`) { optionVar -clearArray displayPolyVertexSize; optionVar -floatValue displayPolyVertexSize 3.0 -floatValueAppend displayPolyVertexSize 3.0; } // Vertices Backculling if ($forceFactorySettings || !`optionVar -exists displayPolyVtxBackCull`) { optionVar -clearArray displayPolyVtxBackCull; optionVar -intValue displayPolyVtxBackCull 1 -intValueAppend displayPolyVtxBackCull 1; } // Vertex Normals // if ($forceFactorySettings || !`optionVar -exists displayPolyVertexNormals`) { optionVar -clearArray displayPolyVertexNormals; optionVar -intValue displayPolyVertexNormals 0 -intValueAppend displayPolyVertexNormals 0; } // Edge Display if ($forceFactorySettings || !`optionVar -exists displayPolyEdgeDisp`) { optionVar -clearArray displayPolyEdgeDisp; optionVar -intValue displayPolyEdgeDisp 0 -intValueAppend displayPolyEdgeDisp 0; } // Border Edge Size // if ($forceFactorySettings || !`optionVar -exists displayPolyBorderEdgeSize`) { optionVar -clearArray displayPolyBorderEdgeSize; optionVar -floatValue displayPolyBorderEdgeSize 3.0 -floatValueAppend displayPolyBorderEdgeSize 3.0; } // Border Edge Highlighting // if ($forceFactorySettings || !`optionVar -exists displayPolyBorderEdgeHilite`) { optionVar -clearArray displayPolyBorderEdgeHilite; optionVar -intValue displayPolyBorderEdgeHilite 0 -intValueAppend displayPolyBorderEdgeHilite 0; } // Border Map Highlighting // if ($forceFactorySettings || !`optionVar -exists displayPolyBorderMapHilite`) { optionVar -clearArray displayPolyBorderMapHilite; optionVar -intValue displayPolyBorderMapHilite 0 -intValueAppend displayPolyBorderMapHilite 0; } // Crease Edge Highlighting // if ($forceFactorySettings || !`optionVar -exists displayPolyCreaseEdgeHilite`) { optionVar -clearArray displayPolyCreaseEdgeHilite; optionVar -intValue displayPolyCreaseEdgeHilite 0 -intValueAppend displayPolyCreaseEdgeHilite 0; } // Crease Vertex Highlighting // if ($forceFactorySettings || !`optionVar -exists displayPolyCreaseVertexHilite`) { optionVar -clearArray displayPolyCreaseVertexHilite; optionVar -intValue displayPolyCreaseVertexHilite 0 -intValueAppend displayPolyCreaseVertexHilite 0; } // UV and Display UV Topology Display if ($forceFactorySettings || !`optionVar -exists displayPolyUV`) { optionVar -clearArray displayPolyUV; optionVar -intValue displayPolyUV 0 -intValueAppend displayPolyUV 0; } if ($forceFactorySettings || !`optionVar -exists displayPolyUVTopology`) { optionVar -clearArray displayPolyUVTopology; optionVar -intValue displayPolyUVTopology 0 -intValueAppend displayPolyUVTopology 0; } // UV Size // if ($forceFactorySettings || !`optionVar -exists displayPolyUVSize`) { optionVar -clearArray displayPolyUVSize; optionVar -floatValue displayPolyUVSize 4.0 -floatValueAppend displayPolyUVSize 4.0; } // Normal Size // if ($forceFactorySettings || !`optionVar -exists displayPolyNormalSize`) { optionVar -clearArray displayPolyNormalSize; optionVar -floatValue displayPolyNormalSize 0.4 -floatValueAppend displayPolyNormalSize 0.4; } // Facets Display // if ($forceFactorySettings || !`optionVar -exists displayPolyFacetCentreDisp`) { optionVar -clearArray displayPolyFacetCentreDisp; optionVar -intValue displayPolyFacetCentreDisp 0 -intValueAppend displayPolyFacetCentreDisp 0; } if ($forceFactorySettings || !`optionVar -exists displayPolyFacetNormalDisp`) { optionVar -clearArray displayPolyFacetNormalDisp; optionVar -intValue displayPolyFacetNormalDisp 0 -intValueAppend displayPolyFacetNormalDisp 0; } if ($forceFactorySettings || !`optionVar -exists displayPolyFacetTrngleDisp`) { optionVar -clearArray displayPolyFacetTrngleDisp; optionVar -intValue displayPolyFacetTrngleDisp 0 -intValueAppend displayPolyFacetTrngleDisp 0; } if ($forceFactorySettings || !`optionVar -exists displayPolyFacetWarpDisp`) { optionVar -clearArray displayPolyFacetWarpDisp; optionVar -intValue displayPolyFacetWarpDisp 0 -intValueAppend displayPolyFacetWarpDisp 0; } if ($forceFactorySettings || !`optionVar -exists displayPolyHoleFacesHilite`) { optionVar -clearArray displayPolyHoleFacesHilite; optionVar -intValue displayPolyHoleFacesHilite 1 -intValueAppend displayPolyHoleFacesHilite 1; } if ($forceFactorySettings || !`optionVar -exists displayPolyNumVertex`) { optionVar -clearArray displayPolyNumVertex; optionVar -intValue displayPolyNumVertex 0 -intValueAppend displayPolyNumVertex 0; } if ($forceFactorySettings || !`optionVar -exists displayPolyNumEdge`) { optionVar -clearArray displayPolyNumEdge; optionVar -intValue displayPolyNumEdge 0 -intValueAppend displayPolyNumEdge 0; } if ($forceFactorySettings || !`optionVar -exists displayPolyNumFacet`) { optionVar -clearArray displayPolyNumFacet; optionVar -intValue displayPolyNumFacet 0 -intValueAppend displayPolyNumFacet 0; } if ($forceFactorySettings || !`optionVar -exists displayPolyNumUv`) { optionVar -clearArray displayPolyNumUv; optionVar -intValue displayPolyNumUv 0 -intValueAppend displayPolyNumUv 0; } if ($forceFactorySettings || !`optionVar -exists displayAlphaAsGreyScale`) { optionVar -intValue displayAlphaAsGreyScale 0; } // Backface Culling // if ($forceFactorySettings || !`optionVar -exists displayPolyBackFaceCull`) { optionVar -clearArray displayPolyBackFaceCull; optionVar -intValue displayPolyBackFaceCull 0 -intValueAppend displayPolyBackFaceCull 0; } // Colors // if ($forceFactorySettings || !`optionVar -exists colorShadedDisplay`) { optionVar -clearArray colorShadedDisplay; optionVar -intValue colorShadedDisplay 0 -intValueAppend colorShadedDisplay 0; } if ($forceFactorySettings || !`optionVar -exists colorMaterialChannel`) { optionVar -clearArray colorMaterialChannel; optionVar -intValue colorMaterialChannel 3 // diffuse -intValueAppend colorMaterialChannel 3; } if ($forceFactorySettings || !`optionVar -exists colorMaterialBlend`) { optionVar -clearArray colorMaterialBlend; optionVar -intValue colorMaterialBlend 0 // overwrite -intValueAppend colorMaterialBlend 0; } // Smooth Mesh Preview // if ($forceFactorySettings || !`optionVar -exists smpDisplaySmoothMesh`) { optionVar -clearArray smpDisplaySmoothMesh; optionVar -intValue smpDisplaySmoothMesh 0 // overwrite -intValueAppend smpDisplaySmoothMesh 0; } if ($forceFactorySettings || !`optionVar -exists smpSmoothMeshSelectionMode`) { optionVar -clearArray smpSmoothMeshSelectionMode; optionVar -intValue smpSmoothMeshSelectionMode 0 // overwrite -intValueAppend smpSmoothMeshSelectionMode 0; } if ($forceFactorySettings || !`optionVar -exists smpSmoothLevel`) { optionVar -clearArray smpSmoothLevel; optionVar -intValue smpSmoothLevel 2 // overwrite -intValueAppend smpSmoothLevel 2; } if ($forceFactorySettings || !`optionVar -exists smpDisplaySubdComps`) { optionVar -clearArray smpDisplaySubdComps; optionVar -intValue smpDisplaySubdComps 0 // overwrite -intValueAppend smpDisplaySubdComps 0; } if ($forceFactorySettings || !`optionVar -exists smpContinuity`) { optionVar -clearArray smpContinuity; optionVar -floatValue smpContinuity 1.0 -floatValueAppend smpContinuity 1.0; } if ($forceFactorySettings || !`optionVar -exists smpSmoothUVs`) { optionVar -clearArray smpSmoothUVs; optionVar -intValue smpSmoothUVs 1 // overwrite -intValueAppend smpSmoothUVs 1; } if ($forceFactorySettings || !`optionVar -exists smpPropagateEdgeHardness`) { optionVar -clearArray smpPropagateEdgeHardness; optionVar -intValue smpPropagateEdgeHardness 0 // overwrite -intValueAppend smpPropagateEdgeHardness 0; } if ($forceFactorySettings || !`optionVar -exists smpKeepMapBorders`) { optionVar -clearArray smpKeepMapBorders; optionVar -intValue smpKeepMapBorders 1 // overwrite -intValueAppend smpKeepMapBorders 1; } if ($forceFactorySettings || !`optionVar -exists smpKeepBorder`) { optionVar -clearArray smpKeepBorder; optionVar -intValue smpKeepBorder 0 // overwrite -intValueAppend smpKeepBorder 0; } if ($forceFactorySettings || !`optionVar -exists smpKeepHardEdge`) { optionVar -clearArray smpKeepHardEdge; optionVar -intValue smpKeepHardEdge 0 // overwrite -intValueAppend smpKeepHardEdge 0; } } global proc polysDisplayUpdateCulling (string $parent) { setParent $parent; int $backfaceCulling = `optionMenuGrp -query -select backfaceCullPopup`; checkBoxGrp -edit -enable3 ($backfaceCulling != 1) polyVerticesDisplayCheck; } global proc polysDisplaySetupSetup (string $parent, int $forceFactorySettings) { // Retrieve the option settings // setOptionVars ($forceFactorySettings); setParent $parent; int $o = `optionVar -q displayPolyObjsAffected`; radioButtonGrp -e -sl ($o + 1) polyObjsAffectedRadio; int $vals[3]; int $vals2[3]; int $vals3[3]; int $vals4[3]; int $vals5[3]; int $val; float $fvals[3]; float $fvals2[3]; string $sval; $vals=`optionVar -q displayPolyVtxDisp`; checkBoxGrp -e -v1 $vals[$o] polyVerticesDisplayCheck; $fvals=`optionVar -q displayPolyVertexSize`; floatSliderGrp -e -value $fvals[$o] vertexSizeSlider; $vals =`optionVar -q displayPolyCreaseVertexHilite`; checkBoxGrp -e -v1 $vals[$o] vertexHiliteDisplayCheck; $vals=`optionVar -q displayPolyVtxBackCull`; checkBoxGrp -e -v3 $vals[$o] polyVerticesDisplayCheck; $vals=`optionVar -q displayPolyVertexNormals`; checkBoxGrp -e -v2 $vals[$o] polyVerticesDisplayCheck; $vals=`optionVar -q displayPolyEdgeDisp`; radioButtonGrp -e -sl ($vals[$o] + 1) polyEdgeDisplayRadio; $fvals=`optionVar -q displayPolyBorderEdgeSize`; floatSliderGrp -e -value $fvals[$o] borderEdgeSizeSlider; // Border Edge Highlighting // $vals=`optionVar -q displayPolyBorderEdgeHilite`; $vals2=`optionVar -q displayPolyBorderMapHilite` ; $vals3=`optionVar -q displayPolyCreaseEdgeHilite`; checkBoxGrp -e -v1 $vals[$o] -v2 $vals2[$o] -v3 $vals3[$o] edgeHiliteDisplayCheck; // UV Topology Display - BK $vals=`optionVar -q displayPolyUV`; $vals2 =`optionVar -q displayPolyUVTopology`; checkBoxGrp -e -v1 $vals[$o] -v2 $vals2[$o] polyUVDisplayCheck; $fvals=`optionVar -q displayPolyUVSize`; floatSliderGrp -e -value $fvals[$o] uvSizeSlider; // NormalSize // $fvals=`optionVar -q displayPolyNormalSize`; floatSliderGrp -e -value $fvals[$o] normalSizeSlider; // Facets Display // $vals= `optionVar -q displayPolyFacetCentreDisp` ; $vals2=`optionVar -q displayPolyFacetNormalDisp`; $vals3=`optionVar -q displayPolyFacetTrngleDisp`; $vals4=`optionVar -q displayPolyFacetWarpDisp`; $vals5=`optionVar -q displayPolyHoleFacesHilite`; checkBoxGrp -e -v1 $vals[$o] -v2 $vals2[$o] -v3 $vals3[$o] -v4 $vals4[$o] polyFacetDisplayCheck; checkBoxGrp -e -v1 $vals5[$o] polyFacetDisplayCheck2; // Item numbers Display // $vals= `optionVar -q displayPolyNumVertex` ; $vals2=`optionVar -q displayPolyNumEdge`; $vals3=`optionVar -q displayPolyNumFacet`; $vals4=`optionVar -q displayPolyNumUv`; checkBoxGrp -e -v1 $vals[$o] -v2 $vals2[$o] -v3 $vals3[$o] -v4 $vals4[$o] polyItemDisplayCheck; // Backface Culling // $vals=`optionVar -q displayPolyBackFaceCull`; optionMenuGrp -e -sl ($vals[$o] + 1) backfaceCullPopup; // Colors $vals = `optionVar -q colorShadedDisplay`; checkBoxGrp -e -v1 $vals[$o] colorShadedDisplayCheck; $vals = `optionVar -q colorMaterialChannel`; optionMenuGrp -e -sl ($vals[$o]+1) colorMaterialPopup; $vals = `optionVar -q colorMaterialBlend`; optionMenuGrp -e -sl ($vals[$o]+1) materialBlendPopup; // Smooth Mesh Preview // $vals=`optionVar -q smpDisplaySmoothMesh`; checkBoxGrp -e -value1 ($vals[$o] != 0) SMPCheck; if ($vals[$o] == 1) radioButtonGrp -e -select 1 Display1_RBG; else if ($vals[$o] == 2) radioButtonGrp -e -select 1 Display2_RBG; toggleSMPState; $vals=`optionVar -q smpSmoothMeshSelectionMode`; radioButtonGrp -e -select ($vals[$o]+1) SMPSelectType_RBG; $vals=`optionVar -q smpSmoothLevel`; intSliderGrp -e -value $vals[$o] SMPDivisionLevels_ISG; $vals=`optionVar -q smpDisplaySubdComps`; checkBoxGrp -e -value1 $vals[$o] SMPDisplaySubdCheck; $fvals=`optionVar -q smpContinuity`; floatSliderGrp -e -value $fvals[$o] SMPContinuity_FSG; $vals=`optionVar -q smpSmoothUVs`; checkBoxGrp -e -value1 $vals[$o] SMPSmoothUVsCheck; $vals=`optionVar -q smpPropagateEdgeHardness`; checkBoxGrp -e -value1 $vals[$o] SMPEdgeHardnessCheck; $vals=`optionVar -q smpKeepMapBorders`; if ($vals[$o] == 0) radioButtonGrp -e -select 3 SMPMapBorders_RBG; else if ($vals[$o] == 1) radioButtonGrp -e -select 2 SMPMapBorders_RBG; else radioButtonGrp -e -select 1 SMPMapBorders_RBG; $vals=`optionVar -q smpKeepBorder`; checkBoxGrp -e -value1 $vals[$o] SMPPreserveCheck; $vals=`optionVar -q smpKeepHardEdge`; checkBoxGrp -e -value2 $vals[$o] SMPPreserveCheck; // Update the culling settings // polysDisplayUpdateCulling ($parent); } global proc polysDisplaySetupCallback (string $parent, int $doIt) { setParent $parent; // Set the optionVar's from the control values, and then perform the command // int $o = `radioButtonGrp -q -sl polyObjsAffectedRadio`; if ($o < 1) $o=1; $o--; optionVar -intValue displayPolyObjsAffected $o; int $vals[2]; float $fvals[2]; int $val; $vals=`optionVar -q displayPolyVtxDisp`; $vals[$o]=`checkBoxGrp -q -v1 polyVerticesDisplayCheck`; optionVar -clearArray displayPolyVtxDisp; optionVar -intValue displayPolyVtxDisp $vals[0] -intValueAppend displayPolyVtxDisp $vals[1]; $fvals=`optionVar -q displayPolyVertexSize`; $fvals[$o]=`floatSliderGrp -q -value vertexSizeSlider`; optionVar -clearArray displayPolyVertexSize; optionVar -floatValue displayPolyVertexSize $fvals[0] -floatValueAppend displayPolyVertexSize $fvals[1]; $vals=`optionVar -q displayPolyVtxBackCull`; $vals[$o]=`checkBoxGrp -q -v3 polyVerticesDisplayCheck`; optionVar -clearArray displayPolyVtxBackCull; optionVar -intValue displayPolyVtxBackCull $vals[0] -intValueAppend displayPolyVtxBackCull $vals[1]; $vals=`optionVar -q displayPolyVertexNormals`; $vals[$o]=`checkBoxGrp -q -v2 polyVerticesDisplayCheck`; optionVar -clearArray displayPolyVertexNormals; optionVar -intValue displayPolyVertexNormals $vals[0] -intValueAppend displayPolyVertexNormals $vals[1]; $vals=`optionVar -q displayPolyEdgeDisp`; $vals[$o]=`radioButtonGrp -q -sl polyEdgeDisplayRadio` - 1; optionVar -clearArray displayPolyEdgeDisp; optionVar -intValue displayPolyEdgeDisp $vals[0] -intValueAppend displayPolyEdgeDisp $vals[1]; $fvals=`optionVar -q displayPolyBorderEdgeSize`; $fvals[$o]=`floatSliderGrp -q -value borderEdgeSizeSlider`; optionVar -clearArray displayPolyBorderEdgeSize; optionVar -floatValue displayPolyBorderEdgeSize $fvals[0] -floatValueAppend displayPolyBorderEdgeSize $fvals[1]; $vals=`optionVar -q displayPolyBorderEdgeHilite`; $vals[$o]=`checkBoxGrp -q -v1 edgeHiliteDisplayCheck`; optionVar -clearArray displayPolyBorderEdgeHilite; optionVar -intValue displayPolyBorderEdgeHilite $vals[0] -intValueAppend displayPolyBorderEdgeHilite $vals[1]; $vals=`optionVar -q displayPolyBorderMapHilite`; $vals[$o]=`checkBoxGrp -q -v2 edgeHiliteDisplayCheck`; optionVar -clearArray displayPolyBorderMapHilite; optionVar -intValue displayPolyBorderMapHilite $vals[0] -intValueAppend displayPolyBorderMapHilite $vals[1]; $fvals=`optionVar -q displayPolyUVSize`; $fvals[$o]=`floatSliderGrp -q -value uvSizeSlider`; optionVar -clearArray displayPolyUVSize; optionVar -floatValue displayPolyUVSize $fvals[0] -floatValueAppend displayPolyUVSize $fvals[1]; $vals=`optionVar -q displayPolyCreaseEdgeHilite`; $vals[$o]=`checkBoxGrp -q -v3 edgeHiliteDisplayCheck`; optionVar -clearArray displayPolyCreaseEdgeHilite; optionVar -intValue displayPolyCreaseEdgeHilite $vals[0] -intValueAppend displayPolyCreaseEdgeHilite $vals[1]; $vals=`optionVar -q displayPolyCreaseVertexHilite`; $vals[$o]=`checkBoxGrp -q -v1 vertexHiliteDisplayCheck`; optionVar -clearArray displayPolyCreaseVertexHilite; optionVar -intValue displayPolyCreaseVertexHilite $vals[0] -intValueAppend displayPolyCreaseVertexHilite $vals[1]; $vals=`optionVar -q displayPolyFacetCentreDisp`; $vals[$o]=`checkBoxGrp -q -v1 polyFacetDisplayCheck`; optionVar -clearArray displayPolyFacetCentreDisp; optionVar -intValue displayPolyFacetCentreDisp $vals[0] -intValueAppend displayPolyFacetCentreDisp $vals[1]; $vals=`optionVar -q displayPolyFacetNormalDisp`; $vals[$o]=`checkBoxGrp -q -v2 polyFacetDisplayCheck`; optionVar -clearArray displayPolyFacetNormalDisp; optionVar -intValue displayPolyFacetNormalDisp $vals[0] -intValueAppend displayPolyFacetNormalDisp $vals[1]; $vals=`optionVar -q displayPolyFacetTrngleDisp`; $vals[$o]=`checkBoxGrp -q -v3 polyFacetDisplayCheck`; optionVar -clearArray displayPolyFacetTrngleDisp; optionVar -intValue displayPolyFacetTrngleDisp $vals[0] -intValueAppend displayPolyFacetTrngleDisp $vals[1]; $vals=`optionVar -q displayPolyFacetWarpDisp`; $vals[$o]=`checkBoxGrp -q -v4 polyFacetDisplayCheck`; optionVar -clearArray displayPolyFacetWarpDisp; optionVar -intValue displayPolyFacetWarpDisp $vals[0] -intValueAppend displayPolyFacetWarpDisp $vals[1]; $vals=`optionVar -q displayPolyHoleFacesHilite`; $vals[$o]=`checkBoxGrp -q -v1 polyFacetDisplayCheck2`; optionVar -clearArray displayPolyHoleFacesHilite; optionVar -intValue displayPolyHoleFacesHilite $vals[0] -intValueAppend displayPolyHoleFacesHilite $vals[1]; $vals=`optionVar -q displayPolyNumVertex`; $vals[$o]=`checkBoxGrp -q -v1 polyItemDisplayCheck`; optionVar -clearArray displayPolyNumVertex; optionVar -intValue displayPolyNumVertex $vals[0] -intValueAppend displayPolyNumVertex $vals[1]; $vals=`optionVar -q displayPolyNumEdge`; $vals[$o]=`checkBoxGrp -q -v2 polyItemDisplayCheck`; optionVar -clearArray displayPolyNumEdge; optionVar -intValue displayPolyNumEdge $vals[0] -intValueAppend displayPolyNumEdge $vals[1]; $vals=`optionVar -q displayPolyNumFacet`; $vals[$o]=`checkBoxGrp -q -v3 polyItemDisplayCheck`; optionVar -clearArray displayPolyNumFacet; optionVar -intValue displayPolyNumFacet $vals[0] -intValueAppend displayPolyNumFacet $vals[1]; $vals=`optionVar -q displayPolyNumUv`; $vals[$o]=`checkBoxGrp -q -v4 polyItemDisplayCheck`; optionVar -clearArray displayPolyNumUv; optionVar -intValue displayPolyNumUv $vals[0] -intValueAppend displayPolyNumUv $vals[1]; $fvals=`optionVar -q displayPolyNormalSize`; $fvals[$o]=`floatSliderGrp -q -value normalSizeSlider`; optionVar -clearArray displayPolyNormalSize; optionVar -floatValue displayPolyNormalSize $fvals[0] -floatValueAppend displayPolyNormalSize $fvals[1]; // UV and UV Topology $vals=`optionVar -q displayPolyUV`; $vals[$o]=`checkBoxGrp -q -v1 polyUVDisplayCheck`; optionVar -clearArray displayPolyUV; optionVar -intValue displayPolyUV $vals[0] -intValueAppend displayPolyUV $vals[1]; // $vals=`optionVar -q displayPolyUVTopology`; $vals[$o]=`checkBoxGrp -q -v2 polyUVDisplayCheck`; optionVar -clearArray displayPolyUVTopology; optionVar -intValue displayPolyUVTopology $vals[0] -intValueAppend displayPolyUVTopology $vals[1]; // Colors $vals = `optionVar -q colorShadedDisplay`; $vals[$o] = `checkBoxGrp -q -v1 colorShadedDisplayCheck`; optionVar -clearArray colorShadedDisplay; optionVar -intValue colorShadedDisplay $vals[0] -intValueAppend colorShadedDisplay $vals[1]; $vals = `optionVar -q colorMaterialChannel`; $vals[$o] = `optionMenuGrp -q -sl colorMaterialPopup` -1; optionVar -clearArray colorMaterialChannel; optionVar -intValue colorMaterialChannel $vals[0] -intValueAppend colorMaterialChannel $vals[1]; $vals = `optionVar -q colorMaterialBlend`; $vals[$o] = `optionMenuGrp -q -sl materialBlendPopup` -1; optionVar -clearArray colorMaterialBlend; optionVar -intValue colorMaterialBlend $vals[0] -intValueAppend colorMaterialBlend $vals[1]; // Culling $vals=`optionVar -q displayPolyBackFaceCull`; $vals[$o]=`optionMenuGrp -q -sl backfaceCullPopup` - 1; optionVar -clearArray displayPolyBackFaceCull; optionVar -intValue displayPolyBackFaceCull $vals[0] -intValueAppend displayPolyBackFaceCull $vals[1]; // Smooth Mesh Preview $vals=`optionVar -q smpDisplaySmoothMesh`; $vals[$o]=`checkBoxGrp -query -value1 SMPCheck`; if ($vals[$o] != 0) { if (`radioButtonGrp -query -select Display1_RBG` == 1) $vals[$o] = 1; else $vals[$o] = 2; } optionVar -clearArray smpDisplaySmoothMesh; optionVar -intValue smpDisplaySmoothMesh $vals[0] -intValueAppend smpDisplaySmoothMesh $vals[1]; $vals=`optionVar -q smpSmoothMeshSelectionMode`; $vals[$o]=`radioButtonGrp -query -select SMPSelectType_RBG` - 1; if (0 <= $vals[$o] && $vals[$o] <= 2 ) { optionVar -clearArray smpSmoothMeshSelectionMode; optionVar -intValue smpSmoothMeshSelectionMode $vals[0] -intValueAppend smpSmoothMeshSelectionMode $vals[1]; } $vals=`optionVar -q smpSmoothLevel`; $vals[$o]=`intSliderGrp -q -value SMPDivisionLevels_ISG`; optionVar -clearArray smpSmoothLevel; optionVar -intValue smpSmoothLevel $vals[0] -intValueAppend smpSmoothLevel $vals[1]; $vals=`optionVar -q smpDisplaySubdComps`; $vals[$o]=`checkBoxGrp -q -value1 SMPDisplaySubdCheck`; optionVar -clearArray smpDisplaySubdComps; optionVar -intValue smpDisplaySubdComps $vals[0] -intValueAppend smpDisplaySubdComps $vals[1]; $fvals=`optionVar -q smpContinuity`; $fvals[$o]=`floatSliderGrp -q -value SMPContinuity_FSG`; optionVar -clearArray smpContinuity; optionVar -floatValue smpContinuity $fvals[0] -floatValueAppend smpContinuity $fvals[1]; $vals=`optionVar -q smpSmoothUVs`; $vals[$o]=`checkBoxGrp -q -value1 SMPSmoothUVsCheck`; optionVar -clearArray smpSmoothUVs; optionVar -intValue smpSmoothUVs $vals[0] -intValueAppend smpSmoothUVs $vals[1]; $vals=`optionVar -q smpPropagateEdgeHardness`; $vals[$o]=`checkBoxGrp -q -value1 SMPEdgeHardnessCheck`; optionVar -clearArray smpPropagateEdgeHardness; optionVar -intValue smpPropagateEdgeHardness $vals[0] -intValueAppend smpPropagateEdgeHardness $vals[1]; $vals=`optionVar -q smpKeepMapBorders`; $vals[$o]=`radioButtonGrp -q -select SMPMapBorders_RBG`; if (1 <= $vals[$o] && $vals[$o] <= 3) { if (1 == $vals[$o]) $vals[$o] = 2; else if (3 == $vals[$o]) $vals[$o] = 0; else $vals[$o] = 1; } optionVar -clearArray smpKeepMapBorders; optionVar -intValue smpKeepMapBorders $vals[0] -intValueAppend smpKeepMapBorders $vals[1]; $vals=`optionVar -q smpKeepBorder`; $vals[$o]=`checkBoxGrp -query -value1 SMPPreserveCheck`; optionVar -clearArray smpKeepBorder; optionVar -intValue smpKeepBorder $vals[0] -intValueAppend smpKeepBorder $vals[1]; $vals=`optionVar -q smpKeepHardEdge`; $vals[$o]=`checkBoxGrp -query -value2 SMPPreserveCheck`; optionVar -clearArray smpKeepHardEdge; optionVar -intValue smpKeepHardEdge $vals[0] -intValueAppend smpKeepHardEdge $vals[1]; if ($doIt) polysDisplaySetup 0; } // // Procedure Name: // polysDisplaySetupOptions // // Description: // Construct the option box UI. Involves accessing the standard option // box and customizing the UI accordingly. // // Input Arguments: // None. // // Return Value: // None. // proc polysDisplaySetupOptions() { // Name of the command for this option box. // string $commandName = "polysDisplaySetup"; // Build the option box actions. // string $callback = ($commandName + "Callback"); string $setup = ($commandName + "Setup"); // STEP 1: Get the option box. // ============================ // // The value returned is the name of the layout to be used as // the parent for the option box UI. // string $layout = getOptionBox(); setParent $layout; // STEP 2: Pass the command name to the option box. // ================================================= // // Any default option box behaviour based on the command name is set // up with this call. For example, updating the 'Help' menu item with // the name of the command. // string $optionBoxTitle = (uiRes("m_polysDisplaySetup.kCustomPolygonOptions")); setOptionBoxTitle($optionBoxTitle); setOptionBoxCommandName($commandName); // STEP 3: Activate the default UI template. // ========================================== // // Activate the default UI template so that the layout of this // option box is consistent with the layout of the rest of the // application. // setUITemplate -pushTemplate DefaultTemplate; // STEP 4: Create option box contents. // =================================== // // This, of course, will vary from option box to option box. // Turn on the wait cursor. // waitCursor -state 1; tabLayout -tabsVisible 0 -scrollable 1; string $parent = `columnLayout -adjustableColumn 1`; string $tmp = ("setParent " + $layout + "; " + "int $o=(`radioButtonGrp -q -sl polyObjsAffectedRadio` - 1); " + "if ($o >= 0) { optionVar -intValue displayPolyObjsAffected $o ; " + $setup + " " + $layout + " false; }"); radioButtonGrp -numberOfRadioButtons 2 -label (uiRes("m_polysDisplaySetup.kObjectsAffected")) -label1 (uiRes("m_polysDisplaySetup.kSelected")) -label2 (uiRes("m_polysDisplaySetup.kAll")) -cc $tmp polyObjsAffectedRadio; separator; string $optionNormals =(uiRes("m_polysDisplaySetup.kNormals")); // vertices drawing style checkBoxGrp -numberOfCheckBoxes 3 -label (uiRes("m_polysDisplaySetup.kVertices")) -label1 (uiRes("m_polysDisplaySetup.kDisplay")) -label2 $optionNormals -label3 (uiRes("m_polysDisplaySetup.kBackculling")) -cw 4 100 polyVerticesDisplayCheck; checkBoxGrp -numberOfCheckBoxes 1 -label (uiRes("m_polysDisplaySetup.kHighlight")) -label1 (uiRes("m_polysDisplaySetup.kCreaseVertices")) vertexHiliteDisplayCheck; floatSliderGrp -label (uiRes("m_polysDisplaySetup.kVertexSize")) -min 1 -max 10 vertexSizeSlider; separator; radioButtonGrp -numberOfRadioButtons 4 -cw 3 95 -label (uiRes("m_polysDisplaySetup.kEdges")) -label1 (uiRes("m_polysDisplaySetup.kStandard")) -label2 (uiRes("m_polysDisplaySetup.kSoft")) -label3 (uiRes("m_polysDisplaySetup.kHardColor")) -label4 (uiRes("m_polysDisplaySetup.kHard")) polyEdgeDisplayRadio; checkBoxGrp -numberOfCheckBoxes 3 -label (uiRes("m_polysDisplaySetup.kHighlight")) -cw 2 110 -cw 3 120 -label1 (uiRes("m_polysDisplaySetup.kBorderEdges")) -label2 (uiRes("m_polysDisplaySetup.kTextureBorders")) -label3 (uiRes("m_polysDisplaySetup.kCreaseEdges")) edgeHiliteDisplayCheck; floatSliderGrp -label (uiRes("m_polysDisplaySetup.kEdgeWidth")) -min 1 -max 10 borderEdgeSizeSlider; separator; checkBoxGrp -numberOfCheckBoxes 4 -label (uiRes("m_polysDisplaySetup.kFace")) -label1 (uiRes("m_polysDisplaySetup.kCenters")) -label2 $optionNormals -label3 (uiRes("m_polysDisplaySetup.kTriangles")) -label4 (uiRes("m_polysDisplaySetup.kNonplanar")) polyFacetDisplayCheck; checkBoxGrp -numberOfCheckBoxes 1 -label1 (uiRes("m_polysDisplaySetup.kHoles")) polyFacetDisplayCheck2; separator; checkBoxGrp -numberOfCheckBoxes 4 -label (uiRes("m_polysDisplaySetup.kShowItemNumbers")) -labelArray4 (uiRes("m_polysDisplaySetup.kItemVertices")) (uiRes("m_polysDisplaySetup.kItemEdges")) (uiRes("m_polysDisplaySetup.kItemFace")) (uiRes("m_polysDisplaySetup.kItemUVs")) polyItemDisplayCheck; floatSliderGrp -label (uiRes("m_polysDisplaySetup.kNormalsSize")) -min 0.02 -max 10 normalSizeSlider; floatSliderGrp -label (uiRes("m_polysDisplaySetup.kUVSize")) -min 1 -max 10 uvSizeSlider; // UV and UV topology display - BK checkBoxGrp -numberOfCheckBoxes 2 -label (uiRes("m_polysDisplaySetup.kTextureCoordinates")) -labelArray2 (uiRes("m_polysDisplaySetup.kTextureUV")) (uiRes("m_polysDisplaySetup.kTextureUVtopology")) polyUVDisplayCheck; separator; // Colors checkBoxGrp -numberOfCheckBoxes 1 -label (uiRes("m_polysDisplaySetup.kColor")) -label1 (uiRes("m_polysDisplaySetup.kShadedDisplayColor")) colorShadedDisplayCheck; optionMenuGrp -label (uiRes("m_polysDisplaySetup.kColorMaterial")) colorMaterialPopup; { menuItem -label (uiRes("m_polysDisplaySetup.kNone")) materialNoneMenuItem; menuItem -label (uiRes("m_polysDisplaySetup.kAmbient")) materialAmbientMenuItem; menuItem -label (uiRes("m_polysDisplaySetup.kAmbientDiffuse")) materialAmbDiffMenuItem; menuItem -label (uiRes("m_polysDisplaySetup.kDiffuse")) materialDiffuseMenuItem; menuItem -label (uiRes("m_polysDisplaySetup.kSpecular")) materialSpecularMenuItem; menuItem -label (uiRes("m_polysDisplaySetup.kEmission")) materialEmissionMenuItem; setParent -m ..; } optionMenuGrp -label (uiRes("m_polysDisplaySetup.kMaterialBlend")) materialBlendPopup; { menuItem -label (uiRes("m_polysDisplaySetup.kOverwrite")) blendOverwriteItem; menuItem -label (uiRes("m_polysDisplaySetup.kAdd")) blendAddMenuItem; menuItem -label (uiRes("m_polysDisplaySetup.kSubtract")) blendSubractItem; menuItem -label (uiRes("m_polysDisplaySetup.kMultiply")) blendMultiplyItem; menuItem -label (uiRes("m_polysDisplaySetup.kDivide")) blendDivideItem; menuItem -label (uiRes("m_polysDisplaySetup.kAverage")) blendAverageItem; menuItem -label (uiRes("m_polysDisplaySetup.kModulate2x")) blendModulateItem; setParent -m ..; } separator; optionMenuGrp -label (uiRes("m_polysDisplaySetup.kCBackfaceCulling")) -changeCommand ("polysDisplayUpdateCulling " + $parent) backfaceCullPopup; menuItem -label (uiRes("m_polysDisplaySetup.kOff")) backfaceOffMenuItem; menuItem -label (uiRes("m_polysDisplaySetup.kOn")) backfaceOnMenuItem; menuItem -label (uiRes("m_polysDisplaySetup.kKeepWire")) backfaceWireMenuItem; menuItem -label (uiRes("m_polysDisplaySetup.kKeepHardEdges")) backfaceHardEdgeMenuItem; setParent -m ..; separator; // Smooth Mesh Preview checkBoxGrp -numberOfCheckBoxes 1 -label (uiRes("m_polysDisplaySetup.kSMPLabel")) -cc "toggleSMPState" SMPCheck; radioButtonGrp -numberOfRadioButtons 1 -enable `checkBoxGrp -query -value1 SMPCheck` -label (uiRes("m_polysDisplaySetup.kDisplayLabel")) -label1 (uiRes("m_polysDisplaySetup.kCageSmoothMesh")) -cc "toggleSMPState" Display1_RBG; radioButtonGrp -label (uiRes("m_polysDisplaySetup.kSMPEditLabel")) -enable (`checkBoxGrp -q -value1 SMPCheck` && (`radioButtonGrp -q -sl Display1_RBG` == 1)) -columnWidth 1 200 -numberOfRadioButtons 3 -vertical -label1 (uiRes("m_polysDisplaySetup.kSMPEditCage")) -label2 (uiRes("m_polysDisplaySetup.kSMPEditSmoth")) -label3 (uiRes("m_polysDisplaySetup.kSMPEditBoth")) -cc "toggleSMPState" SMPSelectType_RBG; radioButtonGrp -numberOfRadioButtons 1 -enable `checkBoxGrp -query -value1 SMPCheck` -label1 (uiRes("m_polysDisplaySetup.kSmoothMesh")) -shareCollection Display1_RBG -cc "toggleSMPState" Display2_RBG; intSliderGrp -label (uiRes("m_polysDisplaySetup.kDivisionLevels")) -enable `checkBoxGrp -query -value1 SMPCheck` -field true -minValue 0 -maxValue 4 -fieldMinValue 0 -fieldMaxValue 4 -step 1 SMPDivisionLevels_ISG; checkBoxGrp -numberOfCheckBoxes 1 -enable `checkBoxGrp -query -value1 SMPCheck` -label1 (uiRes("m_polysDisplaySetup.kDisplaySubdivisions")) SMPDisplaySubdCheck; // SMP Extra Controls rowLayout -adjustableColumn 1 -columnAttach 1 "both" 50; //used to line up the frame layout properly frameLayout -collapsable 1 -collapse 1 -label (uiRes("m_polysDisplaySetup.kExtraControls")) -font "plainLabelFont" SMPExtraControls_FL; columnLayout -adjustableColumn 1; floatSliderGrp -label (uiRes("m_polysDisplaySetup.kContinuity")) -enable `checkBoxGrp -query -value1 SMPCheck` -field true -columnWidth 1 120 -minValue 0 -maxValue 1.0 -fieldMinValue 0 -fieldMaxValue 1.0 SMPContinuity_FSG; checkBoxGrp -numberOfCheckBoxes 1 -enable `checkBoxGrp -query -value1 SMPCheck` -label1 (uiRes("m_polysDisplaySetup.kSmoothUVs")) -columnWidth 1 120 SMPSmoothUVsCheck; checkBoxGrp -numberOfCheckBoxes 1 -enable `checkBoxGrp -query -value1 SMPCheck` -label1 (uiRes("m_polysDisplaySetup.kEdgeHardness")) -columnWidth 1 120 SMPEdgeHardnessCheck; radioButtonGrp -label (uiRes("m_polysDisplaySetup.kMapBorders")) -enable `checkBoxGrp -query -value1 SMPCheck` -numberOfRadioButtons 3 -vertical -columnWidth 1 120 -label1 (uiRes("m_polysDisplaySetup.kNoSmooth")) -label2 (uiRes("m_polysDisplaySetup.kSmoothInternal")) -label3 (uiRes("m_polysDisplaySetup.kSmoothAll")) SMPMapBorders_RBG; checkBoxGrp -numberOfCheckBoxes 2 -enable `checkBoxGrp -query -value1 SMPCheck` -vertical -label (uiRes("m_polysDisplaySetup.kPreserve")) -columnWidth 1 120 -label1 (uiRes("m_polysDisplaySetup.kGeometryBorders")) -label2 (uiRes("m_polysDisplaySetup.kHardEdges")) SMPPreserveCheck; setParent ..; // end column layout setParent ..; // end frame layout setParent ..; // end row layout separator; setParent ..; setParent ..; // Turn off the wait cursor. // waitCursor -state 0; // Step 5: Deactivate the default UI template. // =========================================== // setUITemplate -popTemplate; // Step 6: Customize the buttons. // ============================== // // Provide more descriptive labels for the buttons. This is not // necessary, but in some cases, for example, a button labelled // 'Create' may be more meaningful to the user than one labelled // 'Apply'. // // Disable those buttons that are not applicable to the option box. // // Attach actions to those buttons that are applicable to the option // box. Note that the 'Close' button has a default action attached // to it that will hide the window. If a a custom action is // attached to the 'Close' button then be sure to call the 'hide the // option box' procedure within the custom action so that the option // box is hidden properly. // 'Apply' button. // string $applyBtn = getOptionBoxApplyBtn(); button -edit -command ($callback + " " + $parent + " " + 1) $applyBtn; // 'Save' button. // string $saveBtn = getOptionBoxSaveBtn(); button -edit -command ($callback + " " + $parent + " " + 0 + "; hideOptionBox") $saveBtn; // 'Reset' button. // string $resetBtn = getOptionBoxResetBtn(); button -edit -command ($setup + " " + $parent + " " + 1) $resetBtn; // Step 7: Set the option box title. // ================================= // setOptionBoxTitle($optionBoxTitle); // Step 8: Customize the 'Help' menu item text. // ============================================ // setOptionBoxHelpTag( "CustomPolygonDisplay" ); // Step 9: Set the current values of the option box. // ================================================= // eval (($setup + " " + $parent + " " + 0)); // Step 10: Show the option box. // ============================= // showOptionBox(); } // // Procedure Name: // assembleCmd // // Description: // Construct the command that will apply the option box values. // // Input Arguments: // None. // proc string assembleCmd() { string $cmd = ""; setOptionVars(false); int $o = `optionVar -q displayPolyObjsAffected`; int $polyEdgeDisp[4]=`optionVar -q displayPolyEdgeDisp`; float $polyBorderSize[3] =`optionVar -q displayPolyBorderEdgeSize`; float $polyVertexSize[3] =`optionVar -q displayPolyVertexSize`; float $polyUVSize[3] =`optionVar -q displayPolyUVSize`; int $polyBorderHilite[3] =`optionVar -q displayPolyBorderEdgeHilite`; int $polyCreaseHilite[3] =`optionVar -q displayPolyCreaseEdgeHilite`; int $polyCreaseVertexHilite[3] =`optionVar -q displayPolyCreaseVertexHilite`; int $polyVtxDisp[3]=`optionVar -q displayPolyVtxDisp`; int $polyVtxNormalsDisp[3]=`optionVar -q displayPolyVertexNormals`; int $polyFacetCntrDisp[3] = `optionVar -q displayPolyFacetCentreDisp`; int $polyFacetNrmlDisp[3] = `optionVar -q displayPolyFacetNormalDisp`; int $polyFacetTrnglDisp[3] = `optionVar -q displayPolyFacetTrngleDisp`; int $polyFacetWarpDisp[3] = `optionVar -q displayPolyFacetWarpDisp`; int $polyHoleFacesHilite[3] =`optionVar -q displayPolyHoleFacesHilite`; int $polyNumVertexDisp[3] = `optionVar -q displayPolyNumVertex`; int $polyNumEdgeDisp[3] = `optionVar -q displayPolyNumEdge`; int $polyNumFacetDisp[3] = `optionVar -q displayPolyNumFacet`; int $polyNumUvDisp[3] = `optionVar -q displayPolyNumUv`; float $polyNormalSize[3] = `optionVar -q displayPolyNormalSize`; int $polyUVDisp[3] = `optionVar -q displayPolyUV`; int $polyUVTopologyDisp[3] = `optionVar -q displayPolyUVTopology`; int $polyBackFaceCull[3] = `optionVar -q displayPolyBackFaceCull`; int $polyColorDisplay[3] = `optionVar -q colorShadedDisplay`; int $polyColorChannel[3] = `optionVar -q colorMaterialChannel`; int $polyMaterialBlend[3] = `optionVar -q colorMaterialBlend`; int $polyVtxBackCull[3] = `optionVar -q displayPolyVtxBackCull`; int $bmh[3]=`optionVar -q displayPolyBorderMapHilite`; string $normalType="-facet"; int $dispNormals=0; if ($polyVtxNormalsDisp[$o] != 0 || $polyFacetNrmlDisp[$o] != 0) { $dispNormals=1; if ($polyVtxNormalsDisp[$o] != 0) { if ($polyFacetNrmlDisp[$o] != 0) $normalType="-pointFacet"; else $normalType="-point"; } else $normalType="-facet"; } string $affectType[] = {"-activeObjects", "-global", "-newPolymesh"}; string $edgeType[] = {"-ae","-se","-hec","-he"}; string $backFaceCull[] = {"-bc","-fb","-wbc","-hb"}; string $facetHiliteType[] = {"full", "border", "center"}; // Force uv display if uv topology display set on // Force uv topology display off if uv display is off if ($polyUVTopologyDisp[$o] != 0) { $polyUVDisp[$o] = true; } if ($polyUVDisp[$o] == 0) { $polyUVTopologyDisp[$o] = false; } // Color strings to convert channel # to string. Must // be the same as for polyOptions command ! string $colorChannelStrings[] = {"none", "ambient", "ambientDiffuse", "diffuse", "specular", "emission"}; // Same as the above these must match polyOptions. string $materialBlendStrings[] = {"overwrite", "add", "subtract", "multiply", "divide", "average", "modulate2x" }; $cmd = "polyOptions " + $affectType[$o] + " " + $edgeType[$polyEdgeDisp[$o]] + " " + " -sb " + $polyBorderSize[$o] + " " + " -sv " + $polyVertexSize[$o] + " " + " -db " + $polyBorderHilite[$o] + " " + " -dmb " + $bmh[$o] + " " + " -dce " + $polyCreaseHilite[$o] + " " + " -dcv " + $polyCreaseVertexHilite[$o] + " " + " -dv " + $polyVtxDisp[$o] + " " + " -dn " + $dispNormals + " " + $normalType + " " + " -dc " + $polyFacetCntrDisp[$o] + " " + " -dt " + $polyFacetTrnglDisp[$o] + " " + " -dw " + $polyFacetWarpDisp[$o] + " " + " -dif " + $polyHoleFacesHilite[$o] + " " + " -din " + $polyNumVertexDisp[$o] + " "+ $polyNumEdgeDisp[$o] + " "+ $polyNumFacetDisp[$o] + " "+ $polyNumUvDisp[$o] + " " + " -sn " + $polyNormalSize[$o] + " " + $backFaceCull[$polyBackFaceCull[$o]] + " " + " -duv " + $polyUVDisp[$o] + " " + " -uvt " + $polyUVTopologyDisp[$o] + " " + " -suv " + $polyUVSize[$o] + " " + " -cs " + $polyColorDisplay[$o] + " " + " -cm " + $colorChannelStrings[$polyColorChannel[$o]] + " " + " -mb " + $materialBlendStrings[$polyMaterialBlend[$o]] + " " + " -bcv " + $polyVtxBackCull[$o] + ";"; // add smooth mesh preview stuff to $cmd // if ($o > 1) $o = 1; $vals = `optionVar -q smpDisplaySmoothMesh`; int $smoothMesh = $vals[$o]; $vals=`optionVar -q smpSmoothMeshSelectionMode`; int $selMode = $vals[$o]; $vals=`optionVar -q smpSmoothLevel`; int $newLevel = $vals[$o]; $vals=`optionVar -q smpDisplaySubdComps`; int $subDivs = $vals[$o]; $fvals=`optionVar -q smpContinuity`; float $newCont = $fvals[$o]; $vals=`optionVar -q smpSmoothUVs`; int $smoothUVs = $vals[$o]; $vals=`optionVar -q smpPropagateEdgeHardness`; int $propEdgeHardness = $vals[$o]; $vals=`optionVar -q smpKeepMapBorders`; int $newMapBorders = $vals[$o]; $vals=`optionVar -q smpKeepBorder`; int $keepBorder = $vals[$o]; $vals=`optionVar -q smpKeepHardEdge`; int $keepHardEdge = $vals[$o]; $cmd = $cmd + " updateSMPAttrs(" + $smoothMesh + ", " + $selMode + ", " + $newLevel + ", " + $subDivs + ", " + $newCont + ", " + $smoothUVs + ", " + $propEdgeHardness + ", " + $newMapBorders + ", " + $keepBorder + ", " + $keepHardEdge + ", " + ($o == 1) + ");"; return $cmd; } // // Procedure Name: // polysDisplaySetup // // Description: // Perform the optionBoxExample1 command using the corresponding // option values. This procedure will also show the option box // window if necessary as well as construct the command string // that will invoke the optionBoxExample1 command with the current // option box values. // // Input Arguments: // 0 - Execute the command. // 1 - Show the option box dialog. // 2 - Return the command. // global proc string polysDisplaySetup(int $action) { string $cmd = ""; switch ($action) { // Execute the command. // case 0: // Get the command. // $cmd = `assembleCmd`; // Execute the command with the option settings. // eval($cmd); break; // Show the option box. // case 1: polysDisplaySetupOptions; break; // Return the command string. // case 2: // Get the command. // $cmd = `assembleCmd`; break; } return $cmd; } // Runs when the Smooth Mesh Preview (SMP) checkbox is toggled. // Enables/disables associated options. // global proc toggleSMPState () { // Enable/disable SMP controls based on current SMP state radioButtonGrp -edit -enable `checkBoxGrp -query -value1 SMPCheck` Display1_RBG; radioButtonGrp -edit -enable `checkBoxGrp -query -value1 SMPCheck` Display2_RBG; radioButtonGrp -edit -enable (`checkBoxGrp -q -value1 SMPCheck` && (`radioButtonGrp -q -select Display1_RBG` == 1)) SMPSelectType_RBG; intSliderGrp -edit -enable `checkBoxGrp -query -value1 SMPCheck` SMPDivisionLevels_ISG; checkBoxGrp -edit -enable `checkBoxGrp -query -value1 SMPCheck` SMPDisplaySubdCheck; floatSliderGrp -edit -enable `checkBoxGrp -query -value1 SMPCheck` SMPContinuity_FSG; checkBoxGrp -edit -enable `checkBoxGrp -query -value1 SMPCheck` SMPSmoothUVsCheck; checkBoxGrp -edit -enable `checkBoxGrp -query -value1 SMPCheck` SMPEdgeHardnessCheck; radioButtonGrp -edit -enable `checkBoxGrp -query -value1 SMPCheck` SMPMapBorders_RBG; checkBoxGrp -edit -enable `checkBoxGrp -query -value1 SMPCheck` SMPPreserveCheck; } // Updates the smooth mesh preview attributes on all selected polygons // global proc updateSMPAttrs (int $smoothMesh, int $selMode, int $newLevel, int $subDivs, float $newCont, int $smoothUVs, int $propEdgeHardness, int $newMapBorders, int $keepBorder, int $keepHardEdge, int $affectsAll) { // get a list of selected polygons string $selection[]; if ($affectsAll) $selection = `ls -typ mesh`; else $selection = `filterExpand -selectionMask 12`; string $nodeName; // ensure objects are selected to prevent crash // (also prevents this proc from running during startup before controls exist) if (size($selection) == 0) return; //update attributes for ($nodeName in $selection) { setAttr ($nodeName + ".displaySmoothMesh") $smoothMesh; setAttr ($nodeName + ".smoothMeshSelectionMode") $selMode; setAttr ($nodeName + ".smoothLevel") $newLevel; setAttr ($nodeName + ".displaySubdComps") $subDivs; setAttr ($nodeName + ".continuity") $newCont; setAttr ($nodeName + ".smoothUVs") $smoothUVs; setAttr ($nodeName + ".propagateEdgeHardness") $propEdgeHardness; setAttr ($nodeName + ".keepMapBorders") $newMapBorders; setAttr ($nodeName + ".keepBorder") $keepBorder; setAttr ($nodeName + ".keepHardEdge") $keepHardEdge; } }