// =========================================================================== // 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. // =========================================================================== //================================================================== // MayaHardware2 Renderer Tab //================================================================== // Description: Utility procedure used by other procedures in this file. // Must be used to account for multiple instances of the same tab. // global proc setParentToHardware2Tab() { // First set the parent to the correct tab layout. // Account for the special "all renderers" master layer layout // when we are using render layers global string $gMasterLayerRendererName; string $renderer = isDisplayingAllRendererTabs() ? $gMasterLayerRendererName : `currentRenderer`; string $tabLayout = rendererTabLayoutName($renderer); setParent $tabLayout; // Now set the parent to the correct column layout setParent hardware2TabColumn; } global proc int displayVertexAnimationCacheControls() { if (!`optionVar -exists "displayVertexAnimationCacheUI"`) { optionVar -intValue "displayVertexAnimationCacheUI" 0; } return `optionVar -q "displayVertexAnimationCacheUI"`; } // Description: // This procedure is to create object type filter layout proc createObjTypeFilterLayout() { // declare global parameters global string $gTabCheckBoxPaths[]; // get name & value array string $nameArrayName = "hardwareRenderingGlobals.objectTypeFilterNameArray"; string $valueArrayName = "hardwareRenderingGlobals.objectTypeFilterValueArray"; frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kObjTypeFilter")) -collapsable true -collapse true hwObjTypeFilter; columnLayout -adjustableColumn true; $gTabCheckBoxPaths = createObjTypeFilterCheckBoxes($valueArrayName, $nameArrayName); setParent ..; setParent ..; } global proc updateSSAO() { string $oldParent = `setParent -query`; setParentToHardware2Tab(); int $ssaoEnabled = `getAttr hardwareRenderingGlobals.ssaoEnable`; attrControlGrp -edit -enable $ssaoEnabled ssaoAmount; attrControlGrp -edit -enable $ssaoEnabled ssaoRadius; //attrControlGrp -edit -enable $ssaoEnabled ssaoFilter; attrControlGrp -edit -enable $ssaoEnabled ssaoFilterRadius; attrControlGrp -edit -enable $ssaoEnabled ssaoSamples; setParent $oldParent; } global proc updateHwFogModeControls() { int $hwFogFalloff = `getAttr hardwareRenderingGlobals.hwFogFalloff`; if ($hwFogFalloff == 0) { disable -v true hwFogDensity; disable -v false hwFogStart; disable -v false hwFogEnd; } else { disable -v false hwFogDensity; disable -v true hwFogStart; disable -v true hwFogEnd; } } global proc updateHwFogAndDofEnabled() { string $oldParent = `setParent -query`; setParentToHardware2Tab(); int $renderMode = `getAttr hardwareRenderingGlobals.renderMode`; if ($renderMode == 0 || // "Wire" $renderMode == 6) // "Bounding Box" { attrControlGrp -edit -enable false hwFogEnable; attrControlGrp -edit -enable false renderDepthOfField; } else { attrControlGrp -edit -enable true hwFogEnable; attrControlGrp -edit -enable true renderDepthOfField; } setParent $oldParent; } global proc updateMB() { string $oldParent = `setParent -query`; setParentToHardware2Tab(); int $mbEnabled = `getAttr hardwareRenderingGlobals.motionBlurEnable`; // attrControlGrp -edit -enable $mbEnabled mbCurved; attrControlGrp -edit -enable $mbEnabled mbType; attrControlGrp -edit -enable $mbEnabled mbShutterFraction; attrControlGrp -edit -enable $mbEnabled mbSamples; int $mbDebugEnabled = ($mbEnabled && (`getAttr hardwareRenderingGlobals.motionBlurMultiframeEnable`)); /* frameLayout -edit -enable $mbEnabled mbFadeOptions; attrControlGrp -edit -enable $mbEnabled mbFadeFilter; attrControlGrp -edit -enable $mbEnabled mbFadeAmount; attrControlGrp -edit -enable $mbEnabled mbFadeTint; attrControlGrp -edit -enable $mbEnabled mbFadeTintA; attrControlGrp -edit -enable $mbEnabled mbFadeEmp; frameLayout -edit -enable $mbEnabled mbMultiOptions; attrControlGrp -edit -enable $mbEnabled mbMultiEnable; int $multiEnabled = ($mbEnabled && (`getAttr hardwareRenderingGlobals.motionBlurMultiframeEnable`)); attrControlGrp -edit -enable $multiEnabled mbMultiChart; attrControlGrp -edit -enable $multiEnabled mbMultiAtlas; */ setParent $oldParent; } global proc updateTransparency() { string $oldParent = `setParent -query`; setParentToHardware2Tab(); int $transparencyAlgorithm = `getAttr hardwareRenderingGlobals.transparencyAlgorithm`; int $qualEnabled = ($transparencyAlgorithm == 3); /* depth peeling */ attrControlGrp -edit -enable $qualEnabled transparentQual; setParent $oldParent; } global proc updateEnableTextureMaxRes() { string $oldParent = `setParent -query`; setParentToHardware2Tab(); int $enableTMRMode = `getAttr hardwareRenderingGlobals.enableTextureMaxRes`; int $textureMaxResMode = `getAttr hardwareRenderingGlobals.textureMaxResMode`; int $manualSliderEnabled = ($enableTMRMode == 1) && ($textureMaxResMode == 1); /*enable==true && mode==kCustom*/ int $manualSliderVisible = ($textureMaxResMode == 1); int $autoSliderVisible = ($textureMaxResMode == 0); attrControlGrp -edit -enable $enableTMRMode TextureMaxResMode; //the manual slider value comes from the attribute attrFieldSliderGrp -edit -enable $manualSliderEnabled -visible $manualSliderVisible TextureMaxRes; //the auto slider is always disabled attrFieldSliderGrp -edit -visible $autoSliderVisible TextureMaxResAuto; setParent $oldParent; } /* global proc updateBloom() { string $oldParent = `setParent -query`; setParentToHardware2Tab(); int $bloomEnabled = `getAttr hardwareRenderingGlobals.bloomEnable`; attrControlGrp -edit -enable $bloomEnabled bloomThreshold; attrControlGrp -edit -enable $bloomEnabled bloomFilter; attrControlGrp -edit -enable $bloomEnabled bloomFilterRadius; attrControlGrp -edit -enable $bloomEnabled bloomFilterAux; attrControlGrp -edit -enable $bloomEnabled bloomAmount; setParent $oldParent; } */ // Hold-Out Handlers global proc checkHoldOut() { int $holdOutMode = `getAttr hardwareRenderingGlobals.holdOutMode`; attrControlGrp -edit -enable $holdOutMode holdOutModeGrp; } global proc updateHoldOutMode() { int $enum = 1; if (`radioButtonGrp -q -select holdOutModeGrp` == 2) $enum = 2; setAttr hardwareRenderingGlobals.holdOutDetailMode $enum; } // MSAA Handlers global proc changeMSAA() { int $msaa = `optionMenuGrp -q -value multisampleMenuInTab`; setAttr hardwareRenderingGlobals.multiSampleCount $msaa; } global proc MSAAchanged() { int $nbItems = `optionMenuGrp -q -numberOfItems multisampleMenuInTab`; if($nbItems > 0) { int $msaa = `getAttr hardwareRenderingGlobals.multiSampleCount`; optionMenuGrp -edit -value $msaa multisampleMenuInTab; } } global proc updateMSAA() { string $oldParent = `setParent -query`; setParentToHardware2Tab(); // Enable int $msaaEnabled = `getAttr hardwareRenderingGlobals.multiSampleEnable`; optionMenuGrp -edit -enable $msaaEnabled multisampleMenuInTab; // Rebuild menu based on ogsRender command string $menuItems[] = `optionMenuGrp -q -ils multisampleMenuInTab`; for ($item in $menuItems) { deleteUI -menuItem $item; } int $maxMSAA = 1; string $multisampleType; string $multisampleTypes[] = `ogsRender -q -availableMultisampleType`; if (size($multisampleTypes) > 0) { setParent -m "multisampleMenuInTab|OptionMenu"; for ($multisampleType in $multisampleTypes) { menuItem -collection "multisampleMenuInTab" -label $multisampleType; int $multisampleCount = int($multisampleType); if ($maxMSAA < $multisampleCount) { $maxMSAA = $multisampleCount; } } setParent -m ..; // Change the active MSAA type if necessary int $msaa = `getAttr "hardwareRenderingGlobals.multiSampleCount"`; if ($msaa > $maxMSAA) { setAttr hardwareRenderingGlobals.multiSampleCount $maxMSAA; } // Set current selction MSAAchanged(); } setParent $oldParent; } // Gamma Handlers global proc updateHW2Gamma() { string $oldParent = `setParent -query`; setParentToHardware2Tab(); int $gammaEnabled = `getAttr hardwareRenderingGlobals.gammaCorrectionEnable`; attrControlGrp -edit -enable $gammaEnabled gammaValue; setParent $oldParent; } // FP Render Target Handlers global proc changeFloatingPointRenderTargetFormat() { string $fp = `optionMenuGrp -q -value floatingPointRenderTargetMenuInTab`; int $enum = 1; if($fp == "R32G32B32A32_FLOAT") { $enum = 1; } else if($fp == "R32G32B32_FLOAT") { $enum = 2; } else if($fp == "R16G16B16A16_FLOAT") { $enum = 3; } setAttr hardwareRenderingGlobals.floatingPointRTFormat $enum; } global proc floatingPointRenderTargetFormatChanged() { int $nbItems = `optionMenuGrp -q -numberOfItems floatingPointRenderTargetMenuInTab`; if($nbItems > 0) { string $fmt = `getAttr -asString hardwareRenderingGlobals.floatingPointRTFormat`; optionMenuGrp -edit -value $fmt floatingPointRenderTargetMenuInTab; } } global proc updateFloatingPointRenderTarget() { string $oldParent = `setParent -query`; setParentToHardware2Tab(); // Enable int $fpEnabled = `getAttr hardwareRenderingGlobals.floatingPointRTEnable`; optionMenuGrp -edit -enable $fpEnabled floatingPointRenderTargetMenuInTab; // Rebuild menu based on ogsRender command string $menuItems[] = `optionMenuGrp -q -ils floatingPointRenderTargetMenuInTab`; for ($item in $menuItems) { deleteUI -menuItem $item; } string $fpFormat; string $fpFormats[] = `ogsRender -q -availableFloatingPointTargetFormat`; if (size($fpFormats) > 0) { setParent -m "floatingPointRenderTargetMenuInTab|OptionMenu"; for ($fpFormat in $fpFormats) { menuItem -collection "floatingPointRenderTargetMenuInTab" -label $fpFormat; } setParent -m ..; // Set current selection floatingPointRenderTargetFormatChanged(); } setParent $oldParent; } global proc HW2GlobalsTabReloadAllTextures() { ogs -reloadTextures; } global proc hwInstancingCheckBoxOnCommand() { // Note this method is re-used in AWhardwareRenderingGlobalsTemplate.mel setAttr hardwareRenderingGlobals.hwInstancing true; } global proc hwInstancingCheckBoxOffCommand() { // Note this method is re-used in AWhardwareRenderingGlobalsTemplate.mel setAttr hardwareRenderingGlobals.hwInstancing false; } global proc hwInstancingChangedCallback() { // Note that there is a similar method in AWhardwareRenderingGlobalsTemplate.mel // which should stay in sync with this method int $value = `getAttr hardwareRenderingGlobals.hwInstancing`; checkBoxGrp -edit -value1 $value hwInstancingCheckBoxGrp; } // Check environment variable to see if we should enable instacing controls global proc updateHWInstancing(string $controlName, string $callBackName) { int $controlExists = `control -exists $controlName`; if (!$controlExists) { return; } // Note this method is re-used in AWhardwareRenderingGlobalsTemplate.mel string $enableHwInstancing = `getenv MAYA_ENABLE_VP2_SHAPE_INSTANCING`; // getenv returns "" when the environment variable doesn't exist if ($enableHwInstancing != "") { // When the environment variable is set we don't connect the check box // to the globals node hwInstancing attribute. Instead we grey out the // control and set the state of the check box based on the environment // variable value. If the environment variable is set to one then // hardware instancing is enabled and the check box will appear checked. // If the environment variable is set to any other value then hardware // instancing is disabled and the check box will not appear checked. // We are also disabling hwInstancing on Mac, so grey-out the checkbox // there. It can still be forced on with the environment variable though. if ($enableHwInstancing == "1") { // If the environment variable is set on, make sure the check box is checked checkBoxGrp -edit -value1 true $controlName; } else { // When the environment variable is set off, make sure the check box is not checked checkBoxGrp -edit -value1 false $controlName; } checkBoxGrp -edit -enable false $controlName; } else { // The environment variable is not set, so connect the check box to the // globals node checkBoxGrp -edit -onCommand hwInstancingCheckBoxOnCommand -offCommand hwInstancingCheckBoxOffCommand $controlName; scriptJob -attributeChange hardwareRenderingGlobals.hwInstancing $callBackName -parent $controlName; // set the value correctly when we first create the UI eval($callBackName + "()"); } } // Description: // This procedure is called to create the "Hardware2" globals tab // in the unified render globals for the maya hardware renderer. global proc createMayaHardware2GlobalsTab() { global string $gBatchRenderOverrideMenu; string $parentForm = `setParent -query`; scrollLayout -horizontalScrollBarThickness 0 scrollLayout; columnLayout -adjustableColumn true hardware2TabColumn; setUITemplate -pushTemplate attributeEditorTemplate; frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kPerfOptions")) -cl false -cll true; columnLayout -adj true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kConsolidateWorld")) -attribute "hardwareRenderingGlobals.consolidateWorld"; if (displayVertexAnimationCacheControls()) { attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kVertexAnimCache")) -attribute "hardwareRenderingGlobals.vertexAnimationCache"; } checkBoxGrp -label1 (uiRes("m_createMayaHardware2GlobalsTab.kHWInstancing")) hwInstancingCheckBoxGrp; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kLightLimit")) -attribute "hardwareRenderingGlobals.maxHardwareLights"; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kTransAlgo")) -attribute "hardwareRenderingGlobals.transparencyAlgorithm" -changeCommand "updateTransparency" transpAlg; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kTransQual")) -attribute "hardwareRenderingGlobals.transparencyQuality" transparentQual; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kTransparentShadow")) -attribute "hardwareRenderingGlobals.transparentShadow" transShadow; // Texture Limits frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kMaxTexResClamping")) -cl false -cll true; columnLayout -adj true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kEnableTextureMaxRes")) -attribute "hardwareRenderingGlobals.enableTextureMaxRes" -changeCommand "updateEnableTextureMaxRes" EnableTextureMaxRes; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kTextureMaxResMode")) -attribute "hardwareRenderingGlobals.textureMaxResMode" -annotation (uiRes("m_createMayaHardware2GlobalsTab.kTextureMaxResModeAnn")) -changeCommand "updateEnableTextureMaxRes" TextureMaxResMode; // Create texture resolution control sliders. Only one will be visible at a time. attrFieldSliderGrp -label "" -visible 0 -attribute "hardwareRenderingGlobals.textureMaxResolution" TextureMaxRes; attrFieldSliderGrp -label "" -enable 0 -attribute "hardwareRenderingGlobals.textureAutoMaxResolution" TextureMaxResAuto; rowLayout -nc 2; text -label ""; button -label (uiRes("m_createMayaHardware2GlobalsTab.kApplyTextureLimits")) -annotation (uiRes("m_createMayaHardware2GlobalsTab.kApplyTextureLimitsAnn")) -width 220 -command "HW2GlobalsTabReloadAllTextures" UpdateTextureLimitsButton; setParent ..; source "generateUvTilePreview.mel"; rowLayout -nc 2; text -label ""; button -label (uiRes("m_createMayaHardware2GlobalsTab.kRebakeUvTilePreviews")) -annotation (uiRes("m_createMayaHardware2GlobalsTab.kRebakeUvTilePreviewsAnn")) -width 220 -command "generateAllUvTilePreviews" UpdateUvTilePreviewsButton; setParent ..; setParent ..; setParent ..; // bake options frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kBakeResParameters")) -cl true -cll true; columnLayout -adj true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kColorTex")) -attribute "hardwareRenderingGlobals.colorBakeResolution"; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kBumpTex")) -attribute "hardwareRenderingGlobals.bumpBakeResolution"; rowLayout -nc 2; text -label ""; button -label (uiRes("m_createMayaHardware2GlobalsTab.kUpdateBaked")) -annotation (uiRes("m_createMayaHardware2GlobalsTab.kUpdateBakedAnn")) -width 220 -command "ogs -rebakeTextures" UpdateBakedTexturesButton; setParent ..; setParent ..; setParent ..; setParent ..; setParent ..; // create ssao frame frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kSsaoOptions")) -collapsable true -collapse true ssaoOptions; columnLayout -adjustableColumn true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kSsaoEnable")) -attribute "hardwareRenderingGlobals.ssaoEnable" -changeCommand "updateSSAO" ssaoEnable; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kSsaoAmount")) -attribute "hardwareRenderingGlobals.ssaoAmount" ssaoAmount; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kSsaoRadius")) -attribute "hardwareRenderingGlobals.ssaoRadius" ssaoRadius; //attrControlGrp -label _L10N(kSsaoFilter, "Filter Name") -attribute "hardwareRenderingGlobals.ssaoFilter" ssaoFilter; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kSsaoFilterRadius")) -attribute "hardwareRenderingGlobals.ssaoFilterRadius" ssaoFilterRadius; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kSsaoSamples")) -attribute "hardwareRenderingGlobals.ssaoSamples" ssaoSamples; setParent ..; setParent ..; // create Hw Fog frame frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kHwFogOptions")) -collapsable true -collapse true hwFogOptions; columnLayout -adjustableColumn true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kHwFogFalloff")) -attribute "hardwareRenderingGlobals.hwFogFalloff" -changeCommand "updateHwFogModeControls" hwFogFalloff; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kHwFogDensity")) -attribute "hardwareRenderingGlobals.hwFogDensity" hwFogDensity; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kHwFogStart")) -attribute "hardwareRenderingGlobals.hwFogStart" hwFogStart; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kHwFogEnd")) -attribute "hardwareRenderingGlobals.hwFogEnd" hwFogEnd; attrColorSliderGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kHwFogColor")) -showButton 0 -attribute "hardwareRenderingGlobals.hwFogColor" hwFogColor; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kHwFogAlpha")) -attribute "hardwareRenderingGlobals.hwFogAlpha" hwFogAlpha; setParent ..; setParent ..; // create mb frame frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kMbOptions")) -collapsable true -collapse true mbOptions; columnLayout -adjustableColumn true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbEnable")) -attribute "hardwareRenderingGlobals.motionBlurEnable" -changeCommand "updateMB" mbEnable; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbType")) -attribute "hardwareRenderingGlobals.motionBlurType" mbType; // attrControlGrp -label _L10N(kMbCurved, "Curved Motion Blur") -attribute "hardwareRenderingGlobals.motionBlurCurved" mbCurved; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbShutterFracton")) -attribute "hardwareRenderingGlobals.motionBlurShutterOpenFraction" mbShutterFraction; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbSamples")) -attribute "hardwareRenderingGlobals.motionBlurSampleCount" mbSamples; //attrControlGrp -label _L10N(kMbDebugEnable, "DebugEnable") -attribute "hardwareRenderingGlobals.motionBlurMultiframeEnable" -changeCommand "updateMB" mbDebugEnabled; setParent ..; setParent ..; /* frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kMbFadeOptions")) -collapsable true -collapse false mbFadeOptions; columnLayout -adjustableColumn true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbFadeFilter")) -attribute "hardwareRenderingGlobals.motionBlurFadeFilter" mbFadeFilter; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbFadeAmount")) -attribute "hardwareRenderingGlobals.motionBlurFadeAmount" mbFadeAmount; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbFadeTint")) -attribute "hardwareRenderingGlobals.motionBlurFadeTint" mbFadeTint; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbFadeTintA")) -attribute "hardwareRenderingGlobals.motionBlurFadeTintA" mbFadeTintA; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbFadeEmp")) -attribute "hardwareRenderingGlobals.motionBlurFadeEmphasis" mbFadeEmp; setParent ..; setParent ..; frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kMbMultiOptions")) -collapsable true -collapse false mbMultiOptions; columnLayout -adjustableColumn true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbMultiEnable")) -attribute "hardwareRenderingGlobals.motionBlurMultiframeEnable" -changeCommand "updateMB" mbMultiEnable; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbMultiChart")) -attribute "hardwareRenderingGlobals.motionBlurMultiframeChartSize" mbMultiChart; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMbMultiAtlas")) -attribute "hardwareRenderingGlobals.motionBlurAtlasSize" mbMultiAtlas; setParent ..; setParent ..; setParent ..; setParent ..; */ /* // create bloom frame frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kBloomOptions")) -collapsable true -collapse true bloomOptions; columnLayout -adjustableColumn true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kBloomEnable")) -attribute "hardwareRenderingGlobals.bloomEnable" -changeCommand "updateBloom" bloomEnable; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kBloomThreshold")) -attribute "hardwareRenderingGlobals.bloomThreshold" bloomThreshold; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kBloomFilter")) -attribute "hardwareRenderingGlobals.bloomFilter" bloomFilter; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kBloomFilterRadius")) -attribute "hardwareRenderingGlobals.bloomFilterRadius" bloomFilterRadius; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kBloomFilterAux")) -attribute "hardwareRenderingGlobals.bloomFilterAux" bloomFilterAux; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kBloomAmount")) -attribute "hardwareRenderingGlobals.bloomAmount" bloomAmount; setParent ..; setParent ..; */ // create msaa frame frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kAAOptions")) -collapsable true -collapse true msaaOptions; columnLayout -adjustableColumn true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kSmoothWireframe")) -attribute "hardwareRenderingGlobals.lineAAEnable" lineAAEnable; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMsaaEnable")) -attribute "hardwareRenderingGlobals.multiSampleEnable" -changeCommand "updateMSAA" multiSampleEnable; optionMenuGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kMsaaSampleCount")) -changeCommand "changeMSAA" multisampleMenuInTab; // script jobs for MSAA count scriptJob -rp -p multisampleMenuInTab -attributeChange hardwareRenderingGlobals.multiSampleCount "MSAAchanged"; scriptJob -p multisampleMenuInTab -attributeChange hardwareRenderingGlobals.multiSampleEnable "updateMSAA"; scriptJob -p multisampleMenuInTab -attributeChange hardwareRenderingGlobals.multiSampleCount "updateMSAA"; setParent ..; setParent ..; // create floating point RT frame frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kFloatingPointRTOptions")) -collapsable true -collapse true fbrtOptions; columnLayout -adjustableColumn true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kFloatingPointRTEnabled")) -attribute "hardwareRenderingGlobals.floatingPointRTEnable" -changeCommand "updateFloatingPointRenderTarget" floatingPointRTEnable; optionMenuGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kFloatingPointRTFormat")) -changeCommand "changeFloatingPointRenderTargetFormat" floatingPointRenderTargetMenuInTab; // script jobs for fp format scriptJob -rp -p floatingPointRenderTargetMenuInTab -attributeChange hardwareRenderingGlobals.floatingPointRTFormat "floatingPointRenderTargetFormatChanged"; scriptJob -p multisampleMenuInTab -attributeChange hardwareRenderingGlobals.floatingPointRTEnable "updateFloatingPointRenderTarget"; scriptJob -p multisampleMenuInTab -attributeChange hardwareRenderingGlobals.floatingPointRTFormat "updateFloatingPointRenderTarget"; setParent ..; setParent ..; // create batch render options frame int $holdOutMode = `getAttr hardwareRenderingGlobals.holdOutMode`; int $holdOutDetailMode = `getAttr hardwareRenderingGlobals.holdOutDetailMode`; frameLayout -label (uiRes("m_createMayaHardware2GlobalsTab.kBatchOptions")) -collapsable true -collapse true hwRenderOptions; columnLayout -adjustableColumn true; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kHoldOutEnable")) -attribute "hardwareRenderingGlobals.holdOutMode" -enable true -changeCommand "checkHoldOut"; radioButtonGrp -numberOfRadioButtons 2 -enable $holdOutMode -select $holdOutDetailMode -label (uiRes("m_createMayaHardware2GlobalsTab.kHoldOutMode")) -label1 (uiRes("m_createMayaHardware2GlobalsTab.kHoldOutPerObjectMode")) -data1 1 -enable1 1 -label2 (uiRes("m_createMayaHardware2GlobalsTab.kHoldOutAllMode")) -data2 0 -enable2 1 -changeCommand "updateHoldOutMode" holdOutModeGrp; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kXrayEnable")) -attribute "hardwareRenderingGlobals.xrayMode"; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kXrayJointEnable")) -attribute "hardwareRenderingGlobals.xrayJointDisplay"; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kLightingMode")) -attribute "hardwareRenderingGlobals.lightingMode"; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kSingleSidedLighting")) -attribute "hardwareRenderingGlobals.singleSidedLighting"; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kRenderMode")) -attribute "hardwareRenderingGlobals.renderMode" -changeCommand "updateHwFogAndDofEnabled"; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kHwFogEnable")) -enable true -attribute "hardwareRenderingGlobals.hwFogEnable" -changeCommand "updateHwFogModeControls" hwFogEnable; attrControlGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kRenderDepthOfField")) -enable true -attribute "hardwareRenderingGlobals.renderDepthOfField" -annotation (uiRes("m_createMayaHardware2GlobalsTab.kRenderDepthOfFieldAnnot")) renderDepthOfField; optionMenuGrp -label (uiRes("m_createMayaHardware2GlobalsTab.kRenderOverrideName")) $gBatchRenderOverrideMenu; createObjectTypeFilters(0); // setup Object Type Filters array createObjTypeFilterLayout(); // create Object Type Filters frame setParent ..; setParent ..; setUITemplate -popTemplate; setParent ..; setParent ..; formLayout -edit -af scrollLayout "top" 0 -af scrollLayout "bottom" 0 -af scrollLayout "left" 0 -af scrollLayout "right" 0 $parentForm; updateMayaHardware2GlobalsTab(); } global proc updateMayaHardware2GlobalsTab() { updateEnableTextureMaxRes(); updateSSAO(); updateHwFogModeControls(); updateHwFogAndDofEnabled(); updateMB(); /* updateBloom(); */ updateMSAA(); updateTransparency(); updateRenderOverride(); updateFloatingPointRenderTarget(); updateHWInstancing("hwInstancingCheckBoxGrp", "hwInstancingChangedCallback"); }