// =========================================================================== // 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 key corresponding to the current image format. // global proc string getImfImageType() { global string $gImfKey[]; // This is IMF keyword if (size( $gImfKey ) == 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 $imageType = ""; switch ($imageNum) { case 50: // IMF plug-in global string $gImfPlugInKey[]; string $key = `getAttr "defaultRenderGlobals.imfkey"`; for ($i=0; $i < size($gImfPlugInKey); ++$i) { if ($gImfPlugInKey[$i] == $key) { $imageType = $gImfPlugInKey[$i]; break; } } break; case 51: // User defined $imageType = `getAttr "defaultRenderGlobals.imfkey"`; break; // Vector formats are not registered as IMF. case 60: $imageType = "swf"; break; case 61: $imageType = "ai"; break; case 62: $imageType = "svg"; break; case 63: $imageType = "swft"; break; default: $imageType = $gImfKey[$imageNum]; } if ($imageType == "") $imageType = "iff"; return $imageType; }