// =========================================================================== // 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. // =========================================================================== // // Procedure Name: // setMayaSoftwareFrameExt // // Description: // Change the format of the file extension. It sets the internal // attributes to match the requested mode. // global proc setMayaSoftwareFrameExt(string $item, int $force) { if ($force) { removeRenderLayerAdjustmentAndUnlock defaultRenderGlobals.animation; removeRenderLayerAdjustmentAndUnlock defaultRenderGlobals.outFormatControl; removeRenderLayerAdjustmentAndUnlock defaultRenderGlobals.putFrameBeforeExt; removeRenderLayerAdjustmentAndUnlock defaultRenderGlobals.periodInExt; } if (($item == "1") || ($item == "name")) { catch(`setAttr defaultRenderGlobals.animation 0`); catch(`setAttr defaultRenderGlobals.outFormatControl 1`); catch(`setAttr defaultRenderGlobals.periodInExt 1`); } else if (($item == "2") || ($item == "name.ext")) { catch(`setAttr defaultRenderGlobals.animation 0`); catch(`setAttr defaultRenderGlobals.periodInExt 1`); if (`getAttr defaultRenderGlobals.outFormatControl` == 1) catch(`setAttr defaultRenderGlobals.outFormatControl 0`); } else if (($item == "3") || ($item == "name.#.ext")) { catch(`setAttr defaultRenderGlobals.animation 1`); catch(`setAttr defaultRenderGlobals.putFrameBeforeExt 1`); catch(`setAttr defaultRenderGlobals.periodInExt 1`); if (`getAttr defaultRenderGlobals.outFormatControl` == 1) catch(`setAttr defaultRenderGlobals.outFormatControl 0`); } else if (($item == "4") || ($item == "name.ext.#")) { catch(`setAttr defaultRenderGlobals.animation 1`); catch(`setAttr defaultRenderGlobals.putFrameBeforeExt 0`); catch(`setAttr defaultRenderGlobals.periodInExt 1`); if (`getAttr defaultRenderGlobals.outFormatControl` == 1) catch(`setAttr defaultRenderGlobals.outFormatControl 0`); } else if (($item == "5") || ($item == "name.#")) { catch(`setAttr defaultRenderGlobals.animation 1`); catch(`setAttr defaultRenderGlobals.outFormatControl 1`); catch(`setAttr defaultRenderGlobals.periodInExt 1`); } else if (($item == "6") || ($item == "name#.ext")) { catch(`setAttr defaultRenderGlobals.animation 1`); catch(`setAttr defaultRenderGlobals.putFrameBeforeExt 1`); catch(`setAttr defaultRenderGlobals.periodInExt 0`); if (`getAttr defaultRenderGlobals.outFormatControl` == 1) catch(`setAttr defaultRenderGlobals.outFormatControl 0`); } else if (($item == "7") || ($item == "name_#.ext")) { catch(`setAttr defaultRenderGlobals.animation 1`); catch(`setAttr defaultRenderGlobals.putFrameBeforeExt 1`); catch(`setAttr defaultRenderGlobals.periodInExt 2`); if (`getAttr defaultRenderGlobals.outFormatControl` == 1) catch(`setAttr defaultRenderGlobals.outFormatControl 0`); } else if (($item == "8") || ($item == "namec")) { catch(`setAttr defaultRenderGlobals.animation 1`); catch(`setAttr defaultRenderGlobals.outFormatControl 1`); catch(`setAttr defaultRenderGlobals.periodInExt 1`); } else if (($item == "9") || ($item == "namec.ext")) { catch(`setAttr defaultRenderGlobals.animation 1`); catch(`setAttr defaultRenderGlobals.periodInExt 1`); if (`getAttr defaultRenderGlobals.outFormatControl` == 1) catch(`setAttr defaultRenderGlobals.outFormatControl 0`); } else { string $msg = (uiRes("m_setMayaSoftwareFrameExt.kNamingConvention")); error (`format -stringArg $item $msg`); } }