// =========================================================================== // 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. // =========================================================================== proc string renderFlagsShowMenu_uiToMel (string $ui) { string $objects = (uiRes("m_renderFlagsWindow.kObjects")); string $lights = (uiRes("m_renderFlagsWindow.kLights")); string $dynamics = (uiRes("m_renderFlagsWindow.kDynamics")); string $cameras = (uiRes("m_renderFlagsWindow.kCameras")); string $textures = (uiRes("m_renderFlagsWindow.kTextures")); string $materials = (uiRes("m_renderFlagsWindow.kMaterials")); string $general = (uiRes("m_renderFlagsWindow.kGeneral")); string $result = $ui; if ( $ui == $objects ){ $result = "Objects"; } else if ( $ui == $lights ){ $result = "Lights"; } else if ( $ui == $dynamics ){ $result = "Dynamics"; } else if ( $ui == $cameras ){ $result = "Cameras"; } else if ( $ui == $textures ){ $result = "Textures"; } else if ( $ui == $materials ){ $result = "Materials"; } else if ( $ui == $general ){ $result = "General"; } else { uiToMelMsg( "renderFlagsShowMenu_uiToMel", $ui, 0 ); } return $result; } global proc setRenderFlagsWindow( ) // // This procedure sets the mode the Render Flags // window is in. To add new modes, simply add new // itemFilters, a menu item to the optionMenu // that controls this itemFilter, and new cases // in the following procedure to set the channels // the channel box is showing, and the filter the // outliner is using for the objects it's showing // in the Render Flags outliner. { // Get the mode the user is currently in // in order to switch the contents of the // render flags window to the appropriate // filter mode // string $mode = renderFlagsShowMenu_uiToMel(`optionMenu -q -v rndFlagsShowMenu` ); switch( $mode ) { case "Objects": outlinerEditor -e -filter geomFilter rndFlagsOutliner; channelBox -e -fal {"visibility", "doubleSided", "opposite", "smoothShading", "motionBlur", "visibleInReflections", "visibleInRefractions", "castsShadows", "receiveShadows", "geometryAntialiasingOverride", "antialiasingLevel", "shadingSamplesOverride", "shadingSamples", "maxShadingSamples", "volumeSamples", "volumeSamplesOverride", "maxVisibilitySamples", "maxVisibilitySamplesOverride", "primaryVisibility", "boundingBoxScaleX", "boundingBoxScaleY", "boundingBoxScaleZ", "featureDisplacement", "initialSampleRate", "extraSampleRate", "textureThreshold", "normalThreshold", "fixTextureWarp", "gridDivisionPerSpanU", "gridDivisionPerSpanV"} rndFlagsChannelBox; break; case "Lights": outlinerEditor -e -filter lightFilter rndFlagsOutliner; channelBox -e -fal {"intensity", "colorR", "colorG", "colorB", "coneAngle", "decayRate", "useDecayRegions", "emitDiffuse", "emitSpecular", "useRayTraceShadows", "shadowRays", "useDepthMapShadows", "shadColorR", "shadColorG", "shadColorB"} rndFlagsChannelBox; break; case "Dynamics": outlinerEditor -e -filter dynFilter rndFlagsOutliner; channelBox -e -fal {"visibility", "dynamicsWeight", "magnitude", "attenuation", "maxDistance", "applyPerVertex", "rate", "betterIllumination", "surfaceShading", "threshold", "radius", "radius0", "radius1", "tailSize", "motionBlur", "visibleInReflections", "visibleInRefractions", "castsShadows", "receiveShadows", "geometryAntialiasingOverride", "antialiasingLevel", "shadingSamplesOverride", "shadingSamples", "maxShadingSamples", "volumeSamples", "volumeSamplesOverride", "maxVisibilitySamples", "maxVisibilitySamplesOverride", "primaryVisibility"} rndFlagsChannelBox; break; case "Cameras": outlinerEditor -e -filter cameraFilter rndFlagsOutliner; channelBox -e -fal {"renderable", "focalLength", "nearClipPlane", "farClipPlane", "horizontalFilmAperture", "verticalFilmAperture", "horizontalFilmOffset", "verticalFilmOffset", "panZoomEnabled", "renderPanZoom", "horizontalPan", "verticalPan", "zoom", "lensSqueezeRatio", "image", "mask", "depth", "backgroundColorR", "backgroundColorG", "backgroundColorB", "size", "offset", "type", "fit", "displayMode", "displayOnlyIfCurrent", "lockedToCamera", "geometryAntialiasingOverride", "antialiasingLevel", "shadingSamplesOverride", "shadingSamples", "maxShadingSamples" } rndFlagsChannelBox; break; case "Materials": outlinerEditor -e -filter materialFilter rndFlagsOutliner; channelBox -e -fal {"colorR", "colorG", "colorB", "transparencyR", "transparencyG", "transparencyB", "ambientColorR", "ambientColorG", "ambientColorB", "diffuse", "translucence", "translucenceFocus", "translucenceDepth", "cosinePower", "eccentricity", "specularRollOff", "roughness", "highlightSize", "reflectivity", "specularColorR", "specularColorG", "specularColorB", "hideSource", "glowIntensity", "refractions", "refractiveIndex", "reflectionLimit", "refractionLimit", "surfaceThickness", "shadowAttenuation", "lightAbsorbance", "chromaticAberration", "density", "fastDropOff", "useDistance", "useLayer", "useHeight", "noise", "noiseFreq", "noiseAspect", "shadingMapColorR", "shadingMapColorG", "shadingMapColorB" } rndFlagsChannelBox; break; case "Textures": outlinerEditor -e -filter textureFilter rndFlagsOutliner; channelBox -e -fal {"visibility", "repeatU", "repeatV", "rotateUV", "noiseU", "noiseV", "wrapU", "wrapV", "mirrorU", "mirrorV", "stagger", "coverageU", "coverageV", "rotateFrame", "translateFrameU", "translateFrameV", "colorGainR", "colorGainG", "colorGainB", "colorOffsetR", "colorOffsetG", "colorOffsetB", "defaultColorR", "defaultColorG", "defaultColorB", "alphaGain", "alphaOffset", "filter", "filterOffset"} rndFlagsChannelBox; break; case "General": outlinerEditor -e -filter globalRndFilter rndFlagsOutliner; channelBox -e -fal {"renderAll", "animation", "startFrame", "endFrame", "byFrameStep", "maximumMemory", "motionBlur", "width", "height", "edgeAntiAliasing", "useMultiPixelFilter", "shadingSamples", "maxShadingSamples", "volumeSamples", "particleSamples", "visibilitySamples", "maxVisibilitySamples", "enableRaytracing", "enableDepthMaps"} rndFlagsChannelBox; break; } } // // // Creation Date: 15 April, 1997 // // Procedure Name: // renderFlagsWindow // // Description: // Creates a tab for the transform tools in the toolbox. // // Input Arguments: // The parent control that the tab will be created in. // // Return Value: // None. // global proc renderFlagsWindow () { if (!`window -exists renderFlagsWindow`) { // Need to create the window // window -w 400 -h 450 -menuBar true -title (uiRes("m_renderFlagsWindow.kRenderingFlags")) -iconName (uiRes("m_renderFlagsWindow.kRenderFlags")) renderFlagsWindow; // Adds support for the Context Sensitive Help Menu. // addContextHelpProc "renderFlagsWindow" "buildRenderFlagsContextHelpItems"; doHelpMenu("renderFlagsWindow", "renderFlagsWindow"); formLayout -nd 5 rndFlagsForm; columnLayout rndFlagsRow; optionMenu -label (uiRes("m_renderFlagsWindow.kShow")) -cc "setRenderFlagsWindow" rndFlagsShowMenu; menuItem -label (uiRes("m_renderFlagsWindow.kObjects")); menuItem -label (uiRes("m_renderFlagsWindow.kLights")); menuItem -label (uiRes("m_renderFlagsWindow.kDynamics")); menuItem -label (uiRes("m_renderFlagsWindow.kCameras")); menuItem -label (uiRes("m_renderFlagsWindow.kTextures")); menuItem -label (uiRes("m_renderFlagsWindow.kMaterials")); menuItem -label (uiRes("m_renderFlagsWindow.kGeneral")); setParent -m ..; setParent ..; separator rndFlagsSep1; if (!`itemFilter -exists geomFilter`) { // create a filter for geometry objects // itemFilter //-parent "renderFlagsWindow" //-byType "geometryShape" geomFilter; -byType "surfaceShape" -byType "renderSphere" -byType "renderCone" -classification "builtIn" geomFilter; // create a filter for cameras // itemFilter //-parent "renderFlagsWindow" -byType "camera" -byType "imagePlane" -classification "builtIn" cameraFilter; // create a filter for dynamics // itemFilter //-parent "renderFlagsWindow" -byType "particle" -byType "rigidBody" -byType "field" -classification "builtIn" dynFilter; // create a filter for lights // itemFilter //-parent "renderFlagsWindow" -byType "light" -classification "builtIn" lightFilter; // create a filter for render globals // itemFilter //-parent "renderFlagsWindow" -byType "renderGlobals" -byType "resolution" -byType "renderQuality" -classification "builtIn" globalRndFilter; // create a filter for textures // itemFilter //-parent "renderFlagsWindow" -byType "place3dTexture" -byType "place2dTexture" -byType "texture3d" -byType "texture2d" -byType "textureEnv" -classification "builtIn" textureFilter; // create a filter for materials // itemFilter //-parent "renderFlagsWindow" -byType "lambert" -byType "lightFog" -byType "useBackground" -byType "shadingMap" -classification "builtIn" materialFilter; } frameLayout -lv false -cll false -cl false rndFlagsFrame; formLayout rndFlagsControlForm; // put an outliner in the window and attach it to the left. // This outliner reads from the "world" list, and outputs // its selected objects to the selected list // outlinerEditor -mainListConnection worldList -selectionConnection activeList -ignoreDagHierarchy true -filter geomFilter -showShapes true -showDagOnly false -highlightActive true -autoSelectNewObjects false rndFlagsOutliner; // create a channelBox and put it on the right // hand side of the window. Use the output of the outliner // as the input of the channelBox. // channelBox -fal {"visibility","doubleSided","opposite","smoothShading", "motionBlur","visibleInReflections","visibleInRefractions", "castsShadows", "receiveShadows", "geometryAntialiasingOverride", "antialiasingLevel", "shadingSamplesOverride", "shadingSamples", "maxShadingSamples", "volumeSamples", "volumeSamplesOverride", "maxVisibilitySamples", "maxVisibilitySamplesOverride", "bmv","primaryVisibility", "boundingBoxScaleX", "boundingBoxScaleY", "boundingBoxScaleZ", "featureDisplacement", "initialSampleRate", "extraSampleRate", "textureThreshold", "normalThreshold", "fixTextureWarp", "gridDivisionPerSpanU", "gridDivisionPerSpanV" } -mainListConnection activeList -showTransforms false -longNames true -width 275 rndFlagsChannelBox; setParent ..; setParent ..; if(`about -mac`){ // Some how on the Mac, the -ac is not working when outliner // and channel box is used. So changed the way these // two controls are attached. formLayout -e -af rndFlagsOutliner top 0 -af rndFlagsOutliner left 0 -af rndFlagsOutliner bottom 0 -ap rndFlagsOutliner right 0 50 -af rndFlagsChannelBox top 0 -af rndFlagsChannelBox right 0 -af rndFlagsChannelBox bottom 0 -ap rndFlagsChannelBox left 0 50 rndFlagsControlForm; }else{ formLayout -e -af rndFlagsOutliner top 0 -af rndFlagsOutliner left 0 -af rndFlagsOutliner bottom 0 -ac rndFlagsOutliner right 0 rndFlagsChannelBox -af rndFlagsChannelBox top 0 -af rndFlagsChannelBox right 0 -af rndFlagsChannelBox bottom 0 -an rndFlagsChannelBox left rndFlagsControlForm; } separator rndFlagsSep2; button -label (uiRes("m_renderFlagsWindow.kClose")) -c "deleteUI renderFlagsWindow" -height 26 rndFlagsDelBtn; // Do all the attachments // formLayout -e -af rndFlagsRow top 0 -af rndFlagsRow left 0 -an rndFlagsRow bottom -ac rndFlagsFrame top 0 rndFlagsRow -af rndFlagsFrame left 0 -af rndFlagsFrame right 0 -ac rndFlagsFrame bottom 5 rndFlagsDelBtn -an rndFlagsDelBtn top -af rndFlagsDelBtn left 5 -af rndFlagsDelBtn right 5 -af rndFlagsDelBtn bottom 5 rndFlagsForm; } // Show the window // showWindow renderFlagsWindow; } ////////////////////////////////////////////////////////////////////// // // Procedure Name: // buildRenderFlagsContextHelpItems // // Description: // Build context sensitive menu items for the render flags. // // Input Arguments: // $nameRoot - name to use as the root of all item names // $menuParent - the name of the parent of this menu // // Return Value: // None // global proc buildRenderFlagsContextHelpItems(string $nameRoot, string $menuParent) { menuItem -label (uiRes("m_renderFlagsWindow.kHelpOnRenderFlags")) -enableCommandRepeat false -command "showHelp RenderingFlags"; }