filmov
tv
Maya Mel Scripting Пишем сборщик текстур
Показать описание
if (`window -ex TrueArchivator`) deleteUI TrueArchivator;
window TrueArchivator;
frameLayout -lv 0 -mw 10 -mh 10;
rowLayout -nc 2;
text -l "Browse path" -w 500 pathText;
button -l "Browse" -c "BrowsePath()";
setParent..;
button -l "Archive" -c "Arhcive()";
showWindow TrueArchivator;
global proc BrowsePath() {
string $path[] = `fileDialog2 -fm 3`;
text -e -l $path pathText;
}
global proc Arhcive() {
string $newPath = `text -q -l pathText`;
string $files[] = `ls -typ "file"`;
for ($each in $files) {
string $sourcePath = `getAttr ($each + ".fileTextureName")`;
string $fileName = basename ($sourcePath, "");
string $targetFile = $newPath + "/" + $fileName;
sysFile -cp $targetFile $sourcePath;
}
}
window TrueArchivator;
frameLayout -lv 0 -mw 10 -mh 10;
rowLayout -nc 2;
text -l "Browse path" -w 500 pathText;
button -l "Browse" -c "BrowsePath()";
setParent..;
button -l "Archive" -c "Arhcive()";
showWindow TrueArchivator;
global proc BrowsePath() {
string $path[] = `fileDialog2 -fm 3`;
text -e -l $path pathText;
}
global proc Arhcive() {
string $newPath = `text -q -l pathText`;
string $files[] = `ls -typ "file"`;
for ($each in $files) {
string $sourcePath = `getAttr ($each + ".fileTextureName")`;
string $fileName = basename ($sourcePath, "");
string $targetFile = $newPath + "/" + $fileName;
sysFile -cp $targetFile $sourcePath;
}
}
Комментарии