maya贴图路径找回脚本(7)

2019-01-10 13:14

} } waitCursor -state off; }

////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// //

//Comand executed when Browse button pressed. //

global proc FTM_BrowseCmd (string $FTM_FileOrPath, string $FTM_TextField, string $FTM_WhichButton, int $FTM_BrowseType) //$FTM_FileOrPath Pass to FTM_ChangeTextField //$FTM_TextField Pass to FTM_ChangeTextField //$FTM_WhichButton Pass to fileBrowser, which will be the label of the dialog //$FTM_BrowseType Pass to fileBrowser, which will define to get dialog for file or folder { global string $FTM_WorkSpace; if (size($FTM_WorkSpace) == 0) { $FTM_WorkSpace = `workspace -q -rd` + `workspace -q -rte \ $FTM_WorkSpace = `FTM_GetPath \ } workspace -dir $FTM_WorkSpace; string $FTM_Temp = \ $FTM_Temp += \ $FTM_Temp += (\ $FTM_Temp += (\ fileBrowser $FTM_Temp $FTM_WhichButton \}

/////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// //

//The callback command on fileBrowser. //

global proc FTM_ChangeTextField (string $FTM_FileOrPath, string $FTM_TextField, string $FTM_File, string $FTM_FileType) //$FTM_FileOrPath How to deal with the input path , will be pass to FTM_GetPath //$FTM_TextField The name of the control need to be edited //$FTM_File The file specified //$FTM_FileType The file type specified

{ string $FTM_Path = `FTM_GetPath $FTM_FileOrPath $FTM_File`; textFieldButtonGrp -e -text (toNativePath($FTM_Path)) $FTM_TextField; //Close the dialog for IRIX/Linux. string $os = `about -os`; if (gmatch($os, \ window -e -vis false projectViewerWindow; global string $FTM_WorkSpace; $FTM_WorkSpace = $FTM_Path; }

///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// //

// Reset the UI to its initial state. //

global proc FTM_ResetUI (string $FTM_OptionColumn,string $FTM_AnalysisColumn,string $FTM_ExtraFunctionColumn,string $FTM_Tabs,string $FTM_CopyButton,string $FTM_MoveButton,string $FTM_SetButton) { waitCursor -state on; // The main window; window -e -wh 380 600 FTM_MainWindow; // Analyse area text -e -l \ if (`columnLayout -q -ex ($FTM_AnalysisColumn + \ deleteUI ($FTM_AnalysisColumn + \ // Operation mode radioButtonGrp -e -select 1 ($FTM_OptionColumn + \ // Source directory field textFieldButtonGrp -e -text \-en 0 ($FTM_OptionColumn + \ // Target directory field string $FTM_CurrentProject = `workspace -q -rd`; string $FTM_CurrentSourceImagesDir = $FTM_CurrentProject + `workspace -q -rte \ string $FTM_SourceImages = `FTM_GetPath \ textFieldButtonGrp -e -text $FTM_SourceImages ($FTM_OptionColumn + \

// Make new folder area checkBoxGrp -e -v1 0 ($FTM_OptionColumn + \ textFieldGrp -e -text \-en 0 ($FTM_OptionColumn + \ // Add prefix area checkBox -e -v 0 ($FTM_OptionColumn + \ textField -e -text \-en 0 ($FTM_OptionColumn + \ // Add suffix area checkBox -e -v 0 ($FTM_OptionColumn + \ textField -e -text \-en 0 ($FTM_OptionColumn + \ // Replace string area checkBoxGrp -e -v1 0 ($FTM_OptionColumn + \ textFieldGrp -e -text \ textFieldGrp -e -text \ // Extra function tab textFieldButtonGrp -e -text \ string $tmp = `workspace -q -rd` + `workspace -q -rte \ $tmp = `FTM_GetPath \ textFieldButtonGrp -e -text $tmp ($FTM_ExtraFunctionColumn + \ intFieldGrp -e -v1 1024 ($FTM_ExtraFunctionColumn + \ intFieldGrp -e -v1 1024 ($FTM_ExtraFunctionColumn + \ optionMenu -e -v \($FTM_ExtraFunctionColumn + \ optionMenu -e -v \($FTM_ExtraFunctionColumn + \ optionMenu -e -v \($FTM_ExtraFunctionColumn + \ checkBox -e -v 0 ($FTM_ExtraFunctionColumn + \ checkBox -e -v 1 ($FTM_ExtraFunctionColumn + \ checkBox -e -v 0 -en 1 ($FTM_ExtraFunctionColumn + \ // Return to the first tab tabLayout -e -sti 1 $FTM_Tabs; // Reset all bottom function buttons button -e -en 1 $FTM_CopyButton; button -e -en 1 $FTM_MoveButton;

button -e -en 1 $FTM_SetButton; global string $FTM_WorkSpace; $FTM_WorkSpace = `workspace -q -rd` + `workspace -q -rte \ $FTM_WorkSpace = `FTM_GetPath \ select -cl; waitCursor -state off; }

////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// //

// The Copy, Move and Set functions. //

global proc FTM_Function (string $FTM_Function, string $FTM_OptionColumn) { global string $lsCmd; string $FTM_SelectedFiles[] = eval($lsCmd + \ if (`FTM_SelCheck $FTM_SelectedFiles`) { waitCursor -state on; FTM_Log \ int $wrong = 0; // First get elements ready. int $FTM_OperationMode = `radioButtonGrp -q -select ($FTM_OptionColumn + \ // Source directory. string $FTM_SourceDirectory; // Target directory. string $FTM_TargetDirectory = `textFieldButtonGrp -q -text ($FTM_OptionColumn + \ $FTM_TargetDirectory = `FTM_GetPath \ // Check if new folder needed. If needed, create one only when the folder does not exist. if ( `checkBoxGrp -q -v1 ($FTM_OptionColumn + \ { string $FTM_NewFolderName = `textFieldGrp -q -text ($FTM_OptionColumn + \ $FTM_TargetDirectory = $FTM_TargetDirectory + $FTM_NewFolderName; if (!`file -q -ex $FTM_TargetDirectory`) { if (`sysFile -md $FTM_TargetDirectory`) FTM_Log \(\created: \\\+

(toNativePath($FTM_TargetDirectory)) + \ else { $wrong = 1; FTM_Log \(\can not be created: \+ (toNativePath($FTM_TargetDirectory)) + \ } } else { if (!`filetest -w $FTM_TargetDirectory`) { $wrong = 1; FTM_Log \(\exists but is not writeable: \+ (toNativePath($FTM_TargetDirectory)) + \ } } $FTM_TargetDirectory = `FTM_GetPath \ } if (!$wrong) { // Define command for function. string $FTM_FunctionCmd; if ($FTM_Function == \ $FTM_FunctionCmd = \ else if ($FTM_Function == \ $FTM_FunctionCmd = \ // base of progress feedback setup int $progress = 0; int $percentage = 0; progressWindow -t \Working...\-pr $progress -ii 1 -min 0 -max `size $FTM_SelectedFiles`; // Execute command of current function for every file texture node selected. for ($FTM_SelectedFile in $FTM_SelectedFiles) { FTM_Log \ if ( `progressWindow -q -ic` ){ FTM_Log \ break; } $wrong = 0; // Check if the dialog has been cancelled $progress += 1; $percentage = $progress * (100/size($FTM_SelectedFiles)); progressWindow -e -pr $progress -st (\\+ $FTM_SelectedFile +


maya贴图路径找回脚本(7).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:标准化党支部资料目录

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: