// =========================================================================== // 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. // =========================================================================== // // Helper for forming the nodePreset command when saving presets for the render // settings. // // Because both the Common Tab and Maya Software Tab share the node // defaultRenderGlobals and defaultRenderResolution, we should only save // the settings in Common Tab when the current render is not Maya Software. // global proc string[] getRenderSettingPresetArgs(string $renderer) { string $globalsNodes[] = `renderer -q -globalsNodes $renderer`; string $savingArgs[] = {}; string $attrInCommonTabRenderGlobals = "renderAll imageFilePrefix imageFormat imfPluginKey " + "animation extensionPadding outFormatControl outFormatExt useMayaFileName " + "useFrameExt putFrameBeforeExt periodInExt renderVersion animationRange " + "startFrame endFrame byFrameStep modifyExtension startExtension byExtension " + "enableDefaultLight preMel postMel preRenderLayerMel postRenderLayerMel " + "preRenderMel postRenderMel renderLayerEnable multiCamNamingMode bufferName"; string $attrInCommonTabResolution = "aspectLock lockDeviceAspectRatio width height imageSizeUnits dotsPerInch " + "pixelDensityUnits deviceAspectRatio pixelAspect"; if ($renderer == "mayaSoftware") { for ($globalsNode in $globalsNodes) { $savingArgs[size($savingArgs)] = ""; } } else { for ($globalsNode in $globalsNodes) { if (`objExists $globalsNode`) { if (`nodeType $globalsNode` == "renderGlobals") $savingArgs[size($savingArgs)] = "-attributes \"" + $attrInCommonTabRenderGlobals + "\""; else if(`nodeType $globalsNode` == "resolution") $savingArgs[size($savingArgs)] = "-attributes \"" + $attrInCommonTabResolution + "\""; else $savingArgs[size($savingArgs)] = ""; } } } return $savingArgs; }