PDA

View Full Version : Plugin that renames your Surfaces



dalecampbelljr
04-18-2005, 10:07 AM
I am looking for a plugin that renames you surfaces all at once instead of one at a time. For example, I use Motion Builder and have multiple characters and I have to name the surfaces in LW8 so there are no dups in MB when I animate. SO there is a bone surface,and skin etc. So I name each surface based on the character i.e bone_char1; bone_char2. Is there a plugin that can do them all at once?

beef
04-21-2005, 10:46 PM
i have a script that does this.
cant remember where i got it from.

copy and paste the following into notepad and save as an lscript.ls.
add as a plugin to modeller.


// start of script
//-----------------------------------------
// LScript Modeler
// Author:g_
// 03.11.29
//-----------------------------------------
@version 2.5
@warnings
@script modeler
@name srfRenamer
sList;
main
{
sName = "_ribbon";
rType = 3;
pCnt = 0;
delNum = 0;
selmode(USER);
pCnt = polycount();
editbegin();
for(i = 1; i < pCnt[1] + 1; i++)
{
pInfo = polyinfo(polygons[i]);
sList += pInfo[1];
}
editend();
sList.sortA();
sList.reduce();
sCnt = sList.count();
pList = @"Entire","a+Name","Name+a","n-Name","Name-n"@;
reqbegin("SurfaceRenamer");
c1 = ctllistbox("SurfaceList",200,200,"lb_count","lb_name");
c4 = ctlchoice("AddType",rType,pList);
c3 = ctlstring("addString",sName);
c5 = ctlinteger("integer",delNum);
ctlactive(c4,"toggleOn",c5);
ctlactive(c4,"toggleOff",c3);
return if !reqpost();
sName = getvalue(c3);
rType = getvalue(c4);
delNum = getvalue(c5);
reqend();
for(i = 1; i < sCnt + 1; i++)
{
dName1 = strright(sList[i],sList[i].count() - delNum);
dName2 = strleft(sList[i],sList[i].count() - delNum);
chgName = @sName + i,sName + sList[i],sList[i] + sName,dName1,[email protected];
NewName = string(chgName[rType]);
if(NewName == preName)
{
NewName = string(NewName + i);
}
renamesurface(sList[i], NewName);
preName = NewName;
}
sList = nil;
}
lb_count
{
return(sList.size());
}
lb_name: index
{
return(sList[index]);
}
toggleOn: v
{
return (v > 3);
}
toggleOff: v
{
return (v < 4);
}

//end of script

zarti
04-22-2005, 08:07 AM
http://www.flay.com/GetDetail.cfm?ID=2027