// =========================================================================== // 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: Date // // Description: // // description // global proc initCreateNodeOptionVars() { // // Description: // This procedure is called when hyperShadePanel.mel is sourced at // startup. // This procedure checks to see that the optionVars which correspond to // create render node options (normal/projection/stencil, with/without // placement, with/without shading group) exist. If they do not exist, // they are created and given default values. // if (!`optionVar -exists createTexturesWithPlacement`) { optionVar -intValue createTexturesWithPlacement true; } if (!`optionVar -exists create2dTextureType`) { optionVar -stringValue create2dTextureType "normal"; } if (!`optionVar -exists createMaterialsWithShadingGroup`) { optionVar -intValue createMaterialsWithShadingGroup true; } } global proc refreshCreateNodeUI() { // // Description: // This procedure is (or is *supposed* to be) called from places which // change the value of create render node options optionVars. // This procedure refreshes all UI which is currently displaying the state // of any of those option vars. // // Refresh the create render node dialog, if it exists // if (`window -exists createRenderNodeWindow`) { setParent createRenderNodeWindow; // Update the create textures with placement checkbox // menuItem -edit -checkBox `optionVar -query createTexturesWithPlacement` placementCheckBox; // Update the create materials with shading groups checkbox // menuItem -edit -checkBox `optionVar -query createMaterialsWithShadingGroup` shadingGroupCheckBox; } // Refresh the hypershade menus, if they exist // // ASSUMPTION: // This code assumes that there is only ever a maximum of one // hyperShadePanel, and that it is called hyperShadePanel1. If a // hyperShadePanel of another name exists, it will not be properly updated. // if ( (`panel -exists hyperShadePanel1`) && (`panel -query -control hyperShadePanel1` != "")) { hyperShadePanelRefreshMenu("hyperShadePanel1", "Create"); } // Refresh the visor menus, if they exist // // ASSUMPTION: // This code assumes that there is only ever a maximum of one // visorPanel, and that it is called visorPanel1. If a // visorPanel of another name exists, it will not be properly updated. // if ( (`panel -exists visorPanel1`) && (`panel -query -control visorPanel1` != "")) { setParent visorPanel1; setParent -menu ("visorPanelMenuFileMenu"); // Update the import textures with placement checkbox // menuItem -edit -checkBox `optionVar -query createTexturesWithPlacement` includePlacementItem; if (`menu -exists ("visorPopupMenuFileMenu")`) { setParent -menu ("visorPopupMenuFileMenu"); // Update the import textures with placement checkbox // menuItem -edit -checkBox `optionVar -query createTexturesWithPlacement` includePlacementItem; } } }