// to current \ // Remember that socket [0] is kept for nodes without texture file specified // Remember that socket [1] is kept for nodes with texture file specified but with the path info missing for ($j=2; $j<$FTM_GroupsSize; $j++) { string $buffer[]; tokenize $FTM_Groups[$j] \ // Get the path of current \ string $FTM_OldPath = $buffer[0]; string $cmp1 = $FTM_CurrentPath; string $cmp2 = $FTM_OldPath; // Windows is not case sensitive to path if (`about -nt`) { $cmp1 = tolower($FTM_CurrentPath); $cmp2 = tolower($FTM_OldPath); } // Compare current path to all \ if ($cmp1 == $cmp2) { // Append current node to current group string $tmp = $FTM_Groups[$j]; $tmp += \ $FTM_Groups[$j] = $tmp; break; } } // No \ if ($j >= $FTM_GroupsSize) { // Create a new \ $FTM_Groups[$FTM_GroupsSize] = $FTM_CurrentPath + \ continue; } } // File texture was specified but the path info was missing else if (size($FTM_CurrentFullPath)){ string $tmp = $FTM_Groups[1]; $tmp += \ $FTM_Groups[1] = $tmp; } // File texture was not specified yet. Append current node to the first socket of groups else{ string $tmp = $FTM_Groups[0];
$tmp += \ $FTM_Groups[0] = $tmp; } } select -cl; return $FTM_Groups; }
/////////////////////////////////////////////////////// /////////////////////////////////////////////////////// //
// Edit the UI Controls after they've been built //
proc FTM_EditUIControl (string $FTM_OptionColumn, string $FTM_HelpForm) {
// Operation mode radioButtonGrp -e -on1 (\-en 0 -tx \\\\\ -on2 (\-e -en 1 -tx \\\\+ $FTM_OptionColumn + \ ($FTM_OptionColumn + \// Set source directory textFieldButtonGrp -e -bc (\\\\\\\+ $FTM_OptionColumn + \ ($FTM_OptionColumn + \// Set target directory textFieldButtonGrp -e -bc (\\\\\\\+ $FTM_OptionColumn + \ ($FTM_OptionColumn + \// Make new folder checkBoxGrp -e -on1 (\-e -en 1 -text \\\\+ $FTM_OptionColumn + \ -of1 (\\ ($FTM_OptionColumn + \// Add prefix checkBox -e -onc (\-e -en 1 -text \\\\+ $FTM_OptionColumn + \ -ofc (\-e -en 0 -text \\\\+ $FTM_OptionColumn + \ ($FTM_OptionColumn + \// Add suffix checkBox -e -onc (\-e -en 1 -text \\\\+ $FTM_OptionColumn +
\ -ofc (\-e -en 0 -text \\\\+ $FTM_OptionColumn + \ ($FTM_OptionColumn + \// Replace string checkBoxGrp -e -on1 (\-e -en 1 -text \\\\+ $FTM_OptionColumn + \textFieldGrp -e -en 1 -text \\\\+ $FTM_OptionColumn + \ -of1 (\-e -en 0 -text \\\\+ $FTM_OptionColumn + \textFieldGrp -e -en 0 -text \\\\+ $FTM_OptionColumn + \ ($FTM_OptionColumn + \
// Help description field string $FTM_HelpDescription = \ $FTM_HelpDescription += \ File Texture Manager works on Windows/IRIX/Linux/MAC, manages file textures in a very handy way.\\n\ $FTM_HelpDescription += \ FTM basic functions:\\n\ $FTM_HelpDescription += \ 1. Analyse scene file textures.\\n\ $FTM_HelpDescription += \ 2. Copy or move the original texture files to user defined path.\\n\ $FTM_HelpDescription += \ 3. Update file textures' path.\\n\ $FTM_HelpDescription += \ 4. Mentalray texture node is supported too.\\n\ $FTM_HelpDescription += \ FTM extra functions:\\n\ $FTM_HelpDescription += \ 1. Substitute file texture path's root string. eg. redirecting sourceiamges...\\n\ $FTM_HelpDescription += \ 2. Memory efficiency setup/unset for file textures according to their resolution. Textures larger than Threshold (in either x or y) will be set to use renderer prefered format (BOT for Maya and .map for mentalray) in setup mode. Corresponding memory-efficient file will be automatically generated if needed. When unset, all textures smaller than threshold in both x and y will be set to use normal textures, from which file the memory efficient texture was generated. BOT unset assume normal texture exist in the same directory. Mentalray .map unset will first check if the normal texture exist. If not, FTM will try to extract one from the .map file. Nodes pointing to sequences will be ignored.\\n\ $FTM_HelpDescription += \ 3. Set filter type to specified type for selected file nodes.\\n\ $FTM_HelpDescription += \ 4. Convert texture file format from \\\selected file nodes. If \\\is not \\\only file nodes whose texture files format match \\\will be handled. For file nodes use image sequence as texture files, the range for conversion need to be specified, so only print out corresponding commands instead of really do the jobs. This function use Maya \\\and mentalray \\%ultility to do the conversion, so make sure them can be found in system executable path.\\n\\n\ $FTM_HelpDescription += \ $FTM_HelpDescription += \ Step 1. Analyse scene file textures.(optional)\\n\
$FTM_HelpDescription += \ Step 2. Select scene file textures (nodes) you want to manage by checking on the related checkers in the UI. You can also do this by your own method, Eg. select them in Hypershade.\\n\ $FTM_HelpDescription += \ Step 3. Set options as needed.\\n\ $FTM_HelpDescription += \ Step 4. Do copy, move or set by pressing related button.\\n\\n\ $FTM_HelpDescription += \ $FTM_HelpDescription += \ 1. Always keep 2 different version for each texture file. Eg. \\\your job using low-res textures to speed the interactant. Just remember to use FileTextureManager to reset each file texture to point to the related high-res texture before rendering. (Add prefix, add suffix or even replace string.)\\n\ $FTM_HelpDescription += \ 2. The FileTextureManager's UI does not update dynamically like what Attribute Editor does, so it is better to re-analyse scene file textures each time you finish an FTM job. This is not necessary if you do not use the Analyse function at all.\\n\\n\ $FTM_HelpDescription += \ $FTM_HelpDescription += \ 1. Final target directory will be equal to target directory plus new folder, if user decide to make a new folder.\\n\ $FTM_HelpDescription += \ 2. Add suffix function has limitation on the texture file name. To be sure it work as desired, the file name must be in a regular format, Eg. \\\\\\ $FTM_HelpDescription += \ 3. Add prfix, add suffix and replace string can be executed at the same time to each file texture. Replace string is caculated first, then add suffix, and add prefix last.\\n\ $FTM_HelpDescription += \ 4. It is highly recommended not to contain \\\suffix, old string and new string.\\n\ $FTM_HelpDescription += \ 5. Sometimes process fails. The reason may be various. The most possible reason could be one of or both the following two: a. Texture file is not found in the source directory; b. Permission denied on reading or writing or deleting.\\n\\n\ $FTM_HelpDescription += \ $FTM_HelpDescription += \ 1. Analysing scene file textures let you know how many file textures there are in the scene, where there are, whether they exist or not, etc. It also allows user select all the texture files point to same path by only one simple click.\\n\ $FTM_HelpDescription += \ 2. How to choose operation mode depends on different source directory status. If file is there where it point to, use Automatic mode, otherwise use Manual mode.\\n\ $FTM_HelpDescription += \ 3. Other functions are pretty definite as marked in the UI.\\n\ scrollField -e -text $FTM_HelpDescription ($FTM_HelpForm + \}
/////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////// //
// judge if the input string is format extension, sequence or just part of file basename //
proc int FTM_FCWhatIs(string $string) {
int $isWhat;
// 0 - format extension // 1 - sequence number
// 2 - nothing, is just file basename // 3 - bot
global string $FTM_FCAllFormats[]; $string = tolower($string);
if (stringArrayCount($string,$FTM_FCAllFormats)) $isWhat = 0;
else if (size(match(\ $isWhat = 1;
else if ($string == \ $isWhat = 3; else $isWhat = 2;
return $isWhat; }
//////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //
// judge texture file format, only according to the possible extension name //
proc string[] FTM_FCFileRegularName(string $file) {
$file = substituteAll (\
string $fileRegularName[] = stringToStringArray(basename($file,\// try to make it like below // [0] - file name
// [1] - the sequency number if presented, or \// [2] - the extension if presented, or \
string $fileName; string $seqNum; string $fileFormat;