Adverti horiz upsell

Renamer 1.0.0 for Maya (maya script)

Rename objects with multiple functions

License
Button download
290 Downloads

Compatibility

  • 7.x, 6.x

Operating Systems

  • Windows

History

Created:03/15/2006
Last Modified:03/15/2006
File Size: 2.81 KB
Infomation:
Script to rename objects in a scene: Contains addprefix, addsuffix, search and replace, rename and number.


Last Update
 2006/03/16 4:15 (pm)


Copyright(c) メルねぇさん 2006 All Rights Reserved.


Source

// Copyright(c) メルねぇさん 2006 All Rights Reserved.
//
//ScriptName : Utility
//Author : メルねぇさん
//LastUpdated : May 14, 2006
//LicenseType : Free
//
//History:
// Test Maiking...
//
//Comment:
// Test Maiking...
// Sample MEL Scripts...
//


window -w 150 -h 350 -t "Renamer";

columnLayout cr_mainCol;

separator -style "in" -w 100 -h 8;

rowColumnLayout -nc 2 -cw 1 50 -cw 2 100;
text -l "Search: " -al "right";
textField -tx "" Searchfield;
setParent "..";
rowColumnLayout -nc 2 -cw 1 50 -cw 2 100;
text -l "Replace: " -al "right";
textField -tx "" Replacefield;
setParent "..";
separator -style "none" -w 100 -h 4;
button -l "Apply" -al "center" -w 150 -c "SerchAndReplace();" -ann "検索置換";

separator -style "none" -w 100 -h 4;

rowColumnLayout -nc 2 -cw 1 50 -cw 2 100;
text -l "Prefix: " -al "right";
textField -tx "" Prefixfield ;
setParent "..";
separator -style "none" -w 150 -h 4;
button -l "Apply" -al "center" -w 150 -c "addPrefix()" -ann "接頭語の追加" ;

separator -style "none" -w 100 -h 4;

rowColumnLayout -nc 2 -cw 1 50 -cw 2 100;
text -l "Suffix: " -al "right";
textField -tx "" Suffixfield ;
setParent "..";
separator -style "none" -w 150 -h 4;
button -l "Apply" -al "center" -w 150 -c "addPrefix()" -ann "接尾語の追加" ;

separator -style "none" -w 100 -h 4;

rowColumnLayout -nc 2 -cw 1 50 -cw 2 100;
text -l "Rename: " -al "right";
textField -tx "" Renamefield;
setParent "..";

rowColumnLayout -nc 2 -cw 1 50 -cw 2 60;
text -l "Padd: " -al "right";
intField -v 4 -w 60 -min 0 Numberfield;
setParent "..";
separator -style "none" -w 100 -h 4;
button -l "Apply" -al "center" -w 150 -c "RenameAndNumber()" -ann "名前変更&シーケンス挿入";

showWindow;

global proc addPrefix()
{
string $Prefix = `textField -q -tx Prefixfield`;

string $objs[] = `ls -sl -long`;

$shortName = getShortName($objs[0]);

$newNameAP = ($Prefix + $shortName);

rename $objs $newNameAP;

}

global proc addSuffix()
{
string $Suffix = `textField -q -tx Suffixfield`;

string $objs[] = `ls -sl -long`;

$shortName = getShortName($objs[0]);

$newNameAS = ($shortName + $Suffix);

rename $newNameAS;
}

global proc SerchAndReplace()
{
string $search = `textField -q -tx Searchfield`;
string $replace = `textField -q -tx Replacefield`;

string $objs[] = `ls -sl -long`;

$shortName = getShortName($objs[0]);

$newNameSR = stringReplace($shortName, $search, $replace);

rename $newNameSR;
}

global proc RenameAndNumber()
{
string $Rename = `textField -q -tx Renamefield`;
int $Number = `intField -q -tx Numberfield`;

string $objs[] = `ls -sl -long`;

$shortName = getShortName($objs[0]);

$newNameRAN = ($Rename + $Number);
}


Please use the Bug System to report any bugs.
Please use the Feature Requests to give me ideas.
Please use the Support Forum if you have any questions or problems.
Please rate and review in the Review section.