// =========================================================================== // 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. // =========================================================================== //================================================================== // // Set up the global arrays that contain the image format extensions. // This has to be separated from the Menu building // code, because other areas of Maya need to access these arrays and if // this is tied into the building of the menus, they can't do this. // // NOTE !!!! WARNING !!!! // If you make a change to the code in this procedure, you also need // to make the corresponding change in the 'buildImageFormatsMenu' procedure // of buildImageFormatsMenu.mel. // // This code is also called from dynPaintMenus.mel since it may // be required for PFX canvas saving. // //================================================================== global string $gImgExt[]; // This is the actual file extension global string $gImfKey[]; // This is the unique imf keyword // ADSK_CLR_MGT_BEGIN global string $gImgEXRCompression[]; // This is the compression type for EXR image global string $gImgEXRPixelType[]; // This is the pixel type for EXR image // ADSK_CLR_MGT_END // Custom formats, handled though user defined IMF plug-ins global string $gImfPlugInExt[]; global string $gImfPlugInKey[]; global proc createImageFormats() { global string $gImgExt[]; // This is the actual file extension global string $gImfKey[]; // This is the unique imf keyword global string $gImfPlugInExt[]; global string $gImfPlugInKey[]; int $i; // These are the default formats that ship with Maya. $i = 0; $gImgExt[$i] = "gif"; $gImfKey[$i] = "gif"; $i = 1; $gImgExt[$i] = "pic"; $gImfKey[$i] = "si"; $i = 2; $gImgExt[$i] = "rla"; $gImfKey[$i] = "rla"; $i = 3; $gImgExt[$i] = "tif"; $gImfKey[$i] = "tif"; $i = 4; $gImgExt[$i] = "tif"; $gImfKey[$i] = "tif"; $i = 5; $gImgExt[$i] = "sgi"; $gImfKey[$i] = "sgi"; $i = 6; $gImgExt[$i] = "als"; $gImfKey[$i] = "als"; $i = 7; $gImgExt[$i] = "iff"; $gImfKey[$i] = "maya"; $i = 8; $gImgExt[$i] = "jpeg"; $gImfKey[$i] = "jpg"; $i = 9; $gImgExt[$i] = "eps"; $gImfKey[$i] = "eps"; $i = 10; $gImgExt[$i] = "iff"; $gImfKey[$i] = "maya"; $i = 11; $gImgExt[$i] = "cin"; $gImfKey[$i] = "cin"; $i = 12; $gImgExt[$i] = "yuv"; $gImfKey[$i] = "yuv"; // 14-18 are not used any more $i = 19; $gImgExt[$i] = "tga"; $gImfKey[$i] = "tga"; $i = 20; $gImgExt[$i] = "bmp"; $gImfKey[$i] = "bmp"; $i = 22; $gImgExt[$i] = "mov"; $gImfKey[$i] = "qt"; $i = 31; $gImgExt[$i] = "psd"; $gImfKey[$i] = "psd"; $i = 32; $gImgExt[$i] = "png"; $gImfKey[$i] = "png"; $i = 35; $gImgExt[$i] = "dds"; $gImfKey[$i] = "dds"; $i = 36; $gImgExt[$i] = "psd"; $gImfKey[$i] = "psdLayered"; // ADSK_CLR_MGT_BEGIN $i = 40; $gImgExt[$i] = "exr"; $gImfKey[$i] = "exr"; global string $gImgEXRCompression[]; // This is the compression type for EXR image global string $gImgEXRPixelType[]; // This is the pixel type for EXR image $gImgEXRCompression[0] = (uiRes("m_createImageFormats.kEXRCompressionNone")); $gImgEXRCompression[1] = "RLE"; $gImgEXRCompression[2] = "ZIPS"; $gImgEXRCompression[3] = "ZIP"; $gImgEXRCompression[4] = "PIZ"; $gImgEXRCompression[5] = "PXR24"; $gImgEXRCompression[6] = "B44"; $gImgEXRPixelType[0] = (uiRes("m_createImageFormats.kEXRPixelTypeFloat")); $gImgEXRPixelType[1] = (uiRes("m_createImageFormats.kEXRPixelTypeHalf")); // ADSK_CLR_MGT_END if (`about -mac`) { $i = 30; $gImgExt[$i] = "pntg"; $gImfKey[$i] = "pntg"; $i = 33; $gImgExt[$i] = "pict"; $gImfKey[$i] = "pict"; $i = 34; $gImgExt[$i] = "qtif"; $gImfKey[$i] = "qtif"; } $i = 13; $gImgExt[$i] = "sgi"; $gImfKey[$i] = "sgi"; if (`about -nt`) { $i = 23; $gImgExt[$i] = "avi"; $gImfKey[$i] = "avi"; } // Now register the formats found in IMF plug-ins string $ext, $key; int $size; int $last = 0; string $imfPlugins[]; $size = size($gImfKey); $imfPlugins = sort(`imfPlugins -q`); for ($i=0; $i