FTM_Log \ break; } $progress = $i; $percentage = $progress * 100 / size($Nodes); progressWindow -e -pr $progress -st (\filter type, please wait...... \+ $percentage + \ string $cmd = \ if (catchQuiet(eval($cmd))) FTM_Log \\\\\\is locked/connected and can NOT be modified!\ else FTM_Log \ } progressWindow -ep; FTM_Log \ FTM_END; waitCursor -state off; } }
////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// //
// Command for BOT setup //
global proc FTM_BOTSetup(int $FTM_BOTMode, string $FTM_ExtraFunctionColumn) //$FTM_BOTMode - 1 Setup // - 0 Unset {
string $FTM_FileNodes[]=`ls -sl -typ file`; if (`FTM_SelCheck $FTM_FileNodes`) { waitCursor -state on; FTM_Log \ int $progress = 0; int $percentage = 0; progressWindow -t \Working...\-pr $progress -ii 1 -min 0 -max `size $FTM_FileNodes`; for ($i=0; $i break; } $progress = $i; $percentage = $progress * 100 / size($FTM_FileNodes); progressWindow -e -pr $progress -st (\ \$percentage + \ // Do not handle sequence textures if (`getAttr ($FTM_FileNodes[$i] + \ FTM_Log \ continue; } int $resolution = `intFieldGrp -q -v1 ($FTM_ExtraFunctionColumn + \ float $xRes = `getAttr ($FTM_FileNodes[$i] + \ float $yRes = `getAttr ($FTM_FileNodes[$i] + \ if ($FTM_BOTMode) {// Setup if ($xRes >= $resolution || $yRes >= $resolution) { string $FTM_File = `getAttr ($FTM_FileNodes[$i] + \ $FTM_File = `substituteAll \ string $FTM_TheBOT = `substitute \ string $BOTCmd = \ -r \\ if (catchQuiet(eval($BOTCmd))) FTM_Log \or the BOT file already exists.\ string $cacheCmd = \ string $pathCmd = \-typ \\\\+ $FTM_FileNodes[$i] + \ if (catchQuiet(eval($cacheCmd))) FTM_Log \and can NOT be modified!\ else if (catchQuiet(eval($pathCmd))) FTM_Log \\\Attribute \\\is locked/connected and can NOT be modified!\ else FTM_Log \ } else FTM_Log \specified threshold, skipped!\ } else {// Cancel if ($xRes <= $resolution && $yRes <= $resolution) { string $cacheCmd = \ string $FTM_File = `getAttr ($FTM_FileNodes[$i] + \ $FTM_File = `substituteAll \ $FTM_File = `substitute \ string $pathCmd = \-typ \\\\+ $FTM_FileNodes[$i] + \ if (catchQuiet(eval($cacheCmd))) FTM_Log \and can NOT be modified!\ else if (catchQuiet(eval($pathCmd))) FTM_Log \\\Attribute \\\is locked/connected and can NOT be modified!\ else FTM_Log \ } else FTM_Log \specified threshold, skipped!\ } } progressWindow -ep; FTM_Log \ FTM_END; waitCursor -state off; } } ////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// // // Command for mentalray memory-mapped texture (.map) setup // global proc FTM_MAPSetup(int $FTM_MAPMode, string $FTM_ExtraFunctionColumn) //$FTM_MAPMode - 1 Setup // - 0 Unset { string $FTM_FileNodes[]=`ls -sl -typ file`; if (`FTM_SelCheck $FTM_FileNodes`) { waitCursor -state on; FTM_Log \ int $progress = 0; int $percentage = 0; progressWindow -t \Working...\-pr $progress -ii 1 -min 0 -max `size $FTM_FileNodes`; for ($i=0; $i FTM_Log \\\Attribute \\\is locked/connected and can NOT be modified!\ else FTM_Log \\\memory-mapped texture setup accomplished.\ } else FTM_Log \specified threshold, skipped!\ } else {// Unset if ($xRes <= $resolution && $yRes <= $resolution) { string $FTM_File = `getAttr ($FTM_FileNodes[$i] + \ $FTM_File = `substituteAll \ string $FTM_TheMAP = $FTM_File; $FTM_File = `substitute \ int $wrong = 0; if (!`file -q -ex $FTM_File`){ FTM_Log \\ FTM_Log \\\\ string $UnMAPCmd = \\\\\\\\+ (encodeString(`toNativePath $FTM_TheMAP`)) + \\\\\\\\+ (encodeString(`toNativePath $FTM_File`)) + \ if (catchQuiet(eval($UnMAPCmd))) { $wrong = 1; FTM_Log \\(\normal texture file from \\\ FTM_Log \\\ Could be permission issue, or 'imf_copy' can not be found in system executable path, or original .map file is not a mentalray memory-mapped texture file.\ } else FTM_Log \\(\succeed. => \\\+ `toNativePath $FTM_File` + \ } if (!$wrong) { string $pathCmd = \-typ \\\\+ $FTM_FileNodes[$i] + \ if (catchQuiet(eval($pathCmd))) FTM_Log \\\Attribute \\\is locked/connected and can NOT be modified!\ else FTM_Log \\\memory-mapped texture file unset