// =========================================================================== // 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. // =========================================================================== // // Returns the file extension corresponding to the current image format. // global proc string getImfImageExt() { global string $gImgExt[]; // This is the actual file extension if (size( $gImgExt ) == 0) { // 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. createImageFormats(); } int $compare; int $imageNum = `getAttr "defaultRenderGlobals.imageFormat"`; // string $imageExt = ""; switch($imageNum) { case 50: // IMF plug-in global string $gImfPlugInExt[]; global string $gImfPlugInKey[]; string $key = `getAttr "defaultRenderGlobals.imfkey"`; for ($i=0; $i < size($gImfPlugInKey); ++$i) { if ($gImfPlugInKey[$i] == $key) { $imageExt = $gImfPlugInExt[$i]; break; } } break; case 51: $imageExt = `getAttr "defaultRenderGlobals.imfkey"`; break; // Vector formats are not registered as IMF. case 60: $imageExt = "swf"; break; case 61: $imageExt = "ai"; break; case 62: $imageExt = "svg"; break; case 63: $imageExt = "swft"; break; default: $imageExt = $gImgExt[$imageNum]; } if ($imageExt == "") $imageExt = "iff"; return $imageExt; }