// =========================================================================== // 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: // setMayaSoftwareImageFormat // // Description: // Change the output format of the rendered images. // global proc setMayaSoftwareImageFormat(string $format) { int $i; string $imgformats[] = { "soft", "si", "softimage", "si", "pic", "si", "wave", "rla", "wavefront", "rla", "tiff", "tif", "tiff16", "tif16", "rgb", "sgi", "rgb16", "sgi16", "alias", "als", "pix", "als", "iff", "maya", "tdi", "maya", "explore", "maya", "jpeg", "jpg", "iff16", "maya16", "cineon", "cin", "fido", "cin", "quantel", "yuv", "qtl", "yuv", "targa", "tga" }; // Apply aliases if necessary for ($i=0 ; $i= 0) { removeRenderLayerAdjustmentAndUnlock defaultRenderGlobals.imageFormat; catch(`setAttr defaultRenderGlobals.imageFormat $val`); return; } global string $gImfKey[]; // This is the unique imf keyword int $size = size($gImfKey); // If the file format array has not been initialized yet, do // so. This routine may be called in dynPaintMenus.mel during // the file save for PFX canvas images. if ($size == 0) { createImageFormats(); $size = size($gImfKey); } // Look for the predefined formats for ($i=0 ; $i<$size ; $i++) { if ($format == $gImfKey[$i]) { removeRenderLayerAdjustmentAndUnlock defaultRenderGlobals.imageFormat; catch(`setAttr defaultRenderGlobals.imageFormat $i`); return; } } // Check to see if this is a plug-in format global string $gImfPlugInKey[]; $size = size($gImfPlugInKey); for ($i=0 ; $i<$size ; $i++) { if ($format == $gImfPlugInKey[$i]) { removeRenderLayerAdjustmentAndUnlock defaultRenderGlobals.imageFormat; catch(`setAttr defaultRenderGlobals.imageFormat 50`); removeRenderLayerAdjustmentAndUnlock defaultRenderGlobals.imfkey; catch(`setAttr -type "string" defaultRenderGlobals.imfkey $format`); return; } } // If we did not find it, try the image extension. This may be // confusing, though, as several format could use the same // extension. global string $gImfPlugInExt[]; $size = size($gImfPlugInExt); for ($i=0 ; $i<$size ; $i++) { if ($format == $gImfPlugInExt[$i]) { removeRenderLayerAdjustmentAndUnlock defaultRenderGlobals.imageFormat; setAttr defaultRenderGlobals.imageFormat 50; removeRenderLayerAdjustmentAndUnlock defaultRenderGlobals.imfkey; catch(`setAttr -type "string" defaultRenderGlobals.imfkey $gImfPlugInKey[$i]`); return; } } }