\ ...... \ // start to work string $FTM_CurrentFile = `getAttr ($FTM_SelectedFile + \ string $FTM_SourceFile[] = `FTM_GetFile $FTM_CurrentFile`; string $FTM_OriginSourceFile = $FTM_SourceFile[1]; // The file texture is not specified. if (size($FTM_OriginSourceFile) == 0) FTM_Log \ // The file texture is specified. else { // If replace string was selected, replace the string specified. if ( `checkBoxGrp -q -v1 ($FTM_OptionColumn + \ { string $FTM_OldString = `textFieldGrp -q -tx ($FTM_OptionColumn + \ string $badChar[] = {\ for ($char in $badChar) $FTM_OldString = `substituteAllString $FTM_OldString $char (\ string $FTM_MatchExpression = \ string $FTM_NewString = `textFieldGrp -q -tx ($FTM_OptionColumn + \ for ($i=0; $i if ( `checkBox -q -v ($FTM_OptionColumn + \ $FTM_Suffix = `textField -q -tx ($FTM_OptionColumn + \ // Assemble the filename if (size($FTM_SourceFileRegularName[1])) $FTM_SourceFileRegularName[1] = \+ $FTM_SourceFileRegularName[1]; if (size($FTM_SourceFileRegularName[2])) $FTM_SourceFileRegularName[2] = \+ $FTM_SourceFileRegularName[2]; $FTM_SourceFile[1] = $FTM_Prefix + $FTM_SourceFileRegularName[0] + $FTM_Suffix + $FTM_SourceFileRegularName[1] + $FTM_SourceFileRegularName[2]; // Function process. string $FTM_FinalCmd; string $FTM_FunctionResult; int $setWrong = 0; if ($FTM_Function != \ { if ($FTM_OperationMode == 1) { $FTM_FinalCmd = $FTM_FunctionCmd + \+ `substituteAll \\ $FTM_FunctionResult = $FTM_Function + \\\\+ `toNativePath $FTM_SourceFile[0]` + \to \\\+ `toNativePath ($FTM_TargetDirectory + $FTM_SourceFile[1])` + \ } else if ($FTM_OperationMode == 2) { $FTM_SourceDirectory = `textFieldButtonGrp -q -text ($FTM_OptionColumn + \ $FTM_SourceDirectory = `FTM_GetPath \$FTM_SourceDirectory`; $FTM_FinalCmd = $FTM_FunctionCmd + \+ `substituteAll \\ $FTM_FunctionResult = $FTM_Function + \\\\+ `toNativePath ($FTM_SourceDirectory + $FTM_OriginSourceFile)` + \($FTM_TargetDirectory + $FTM_SourceFile[1])` + \ } } else if ($FTM_Function == \ { string $path = `substituteAll \($FTM_TargetDirectory + $FTM_SourceFile[1]) \ string $cmd = \-typ \\\\+ $FTM_SelectedFile + \ if (catchQuiet(eval($cmd))) { $FTM_FunctionResult = \\\\is locked/connected and can NOT be modified!\ $setWrong = 1; } else $FTM_FunctionResult = \to \\\+ `toNativePath ($FTM_TargetDirectory + $FTM_SourceFile[1])` + \ } // Do the function. if ($FTM_Function != \ if (!eval($FTM_FinalCmd)) { $wrong = 1; FTM_Log \\(\\+ $FTM_Function + \can NOT be done, could be permission issue or path existence issue.\ } } if (!$wrong) { // Print the function result. if ( `file -q -ex ($FTM_TargetDirectory + $FTM_SourceFile[1])` ) { if ($FTM_Function == \ { // File copied but not removed -- not actually \ if ( `file -q -ex $FTM_SourceFile[0]` || `file -q -ex ($FTM_SourceDirectory + $FTM_OriginSourceFile)`) { $FTM_FunctionResult = \\+ $FTM_FunctionResult + \But the original file is not removed. Check the HELP for possible reasons.\ FTM_Log \\(\\+ $FTM_FunctionResult); } else { $FTM_FunctionResult = \\+ $FTM_FunctionResult; FTM_Log \ } } else { $FTM_FunctionResult = \\+ $FTM_FunctionResult; FTM_Log \ } } else { if ($FTM_Function == \ if ($setWrong) $FTM_FunctionResult = \\+ $FTM_FunctionResult; else $FTM_FunctionResult = \\+ $FTM_FunctionResult + \ } else if ($FTM_Function != \ $FTM_FunctionResult = \+ \ FTM_Log \ } } } } } // finish progress feed back progressWindow -ep; // job done FTM_Log \ FTM_END; waitCursor -state off; } } ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// // //Build the main UI. // global proc FileTextureManager () { // array of formats supported by format conversion function global string $FTM_FCAllFormats[]; $FTM_FCAllFormats = {\gif\ // cover all file texture nodes including mentalray's global string $lsCmd; $lsCmd = \ select -cl; global string $FTM_MayaWorkSpace; $FTM_MayaWorkSpace = `workspace -q -dir`; global string $FTM_WorkSpace = \ //Make sure the window will be displayed in proper size. windowPref -enableAll false; //If the UI exits , delete it. if (`window -exists FTM_MainWindow`) deleteUI FTM_MainWindow; //Build a new UI. window -title \ string $FTM_MainForm = `formLayout`; string $FTM_Tabs = `tabLayout -imw 0 -imh 0`; //Option tab string $FTM_OptionForm = `formLayout`; string $FTM_OptionScroll = `scrollLayout -cr true`; string $FTM_OptionColumn = `columnLayout -adj 1 -rs 5`; //Analyse area formLayout -nd 100 FTM_AnalyseForm; string $FTM_AnalyseColumn = `columnLayout -cat both 30 -adj 1 -rs 5`; button -l \Scene File Textures\-h 30 -w 250 FTM_AnalyseButton; text -l \ text -l \ string $FTM_AnalysisScroll = `scrollLayout -p FTM_AnalyseForm`; string $FTM_AnalysisColumn = `columnLayout -cat left 15`; text -l \
maya贴图路径找回脚本(8)
2019-01-10 13:14
maya贴图路径找回脚本(8).doc
将本文的Word文档下载到电脑
下载失败或者文档不完整,请联系客服人员解决!