// =========================================================================== // 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: 13 April 1997 // // Procedure Name: // RenShadersMenu // // Description: // Create the RENDERING->Shaders menu // // Input Arguments: // parent to parent the menu to. // // Return Value: // None. // global proc refreshShadingMenu( string $parent ) { setParent -m $parent; string $activeList[] = `selectionConnection -query -object activeList`; if (size($activeList) == 1) { menuItem -edit -enable true RenLightingSelectObjectsItem; menuItem -edit -enable true RenLightingSelectLightsItem; menuItem -edit -enable true RenLightingSelectShadowObjectsItem; menuItem -edit -enable true RenLightingSelectShadowLightsItem; } else { menuItem -edit -enable false RenLightingSelectObjectsItem; menuItem -edit -enable false RenLightingSelectLightsItem; menuItem -edit -enable false RenLightingSelectShadowObjectsItem; menuItem -edit -enable false RenLightingSelectShadowLightsItem; } // Giving the chance to third parties to add their baking menu items // removeMenuItems("RenBakingMenuItemsAnchorPoint", "transferMapsItem"); callbacks -executeCallbacks -hook "addBakingMenuItems" "RenBakingMenuItemsAnchorPoint"; } global proc RenShadersMenu( string $parent ) { setParent -m $parent; if( `menu -q -ni $parent` != 0 ) { // // Menu is built already, just refresh it. // refreshShadingMenu($parent); return; } // After the first post builds the menu, change the // post command to refresh the menus items. // menu -edit -postMenuCommand ("refreshShadingMenu " + $parent) -postMenuCommandOnce false $parent; // Materials menuItem -divider true -dividerLabel (uiRes("m_RenShadersMenu.kShadingMaterials")); $cmd = "ShowShadingGroupAttributeEditor"; menuItem -rtc $cmd; buildShaderMenus(""); // Bake menuItem -d true -dividerLabel (uiRes("m_RenShadersMenu.kShadingBaking")) RenBakingMenuItemsAnchorPoint; // Transfer map operations menuItem -label (uiRes("m_RenShadersMenu.kTransferMaps")) -annotation (uiRes("m_RenShadersMenu.kTransferMapsAnnot")) -command "performSurfaceSampling 1" transferMapsItem; menuItem -d true -dividerLabel (uiRes("m_RenShadersMenu.kShadingLightLink")); // Create Light Link Editor sub menu string $menu = `menuItem -label (uiRes("m_RenShadersMenu.kLightLinking")) -sm true -to true`; menu -e -pmc ( "buildLightLinkingEdMenu " + $menu ) $menu; setParent -m ..; $cmd = "MakeLightLinks"; menuItem -rtc $cmd; $cmd = "BreakLightLinks"; menuItem -rtc $cmd; $cmd = "SelectObjectsIlluminatedByLight"; menuItem -rtc $cmd RenLightingSelectObjectsItem; $cmd = "SelectLightsIlluminatingObject"; menuItem -rtc $cmd RenLightingSelectLightsItem; menuItem -d true -longDivider false; $cmd = "MakeShadowLinks"; menuItem -rtc $cmd; $cmd = "BreakShadowLinks"; menuItem -rtc $cmd; $cmd = "SelectObjectsShadowedByLight"; menuItem -rtc $cmd RenLightingSelectShadowObjectsItem; $cmd = "SelectLightsShadowingObject"; menuItem -rtc $cmd RenLightingSelectShadowLightsItem; refreshShadingMenu($parent); }