View Single Post
# 1 17-02-2012 , 10:41 AM
Registered User
Join Date: Jan 2012
Posts: 43

Help with renaming

Hi there.
I don't know crap about mel.
BUT I'm asking anyway, I have a script that assigns new materials from a selection and renames them based on the object's names.
It's almost perfect from my use, but I need just one more thing to save hours of mind numbing work, a string that changes the first letter of the materials name to an uppercase, this way I have no duplicate names and no numbers as a postfix to material's names.
I have ZERO idea on how to do this, so here's the script (it's not mine I salvaged it from some other guy and modified it a bit)

string $nodeName[] = `ls -sl`;
string $matName, $sgName, $fileName;
for($i=0; $i<size($nodeName); $i++)
{
$matName = `shadingNode -as phong -n ($nodeName[$i])`;
$sgName = `sets -renderable true -noSurfaceShader true -empty -name ($nodeName[$i] + "SG")`;
connectAttr -f ($matName + ".outColor") ($sgName + ".surfaceShader");
select $nodeName[$i];
sets -e -forceElement $sgName;
}
clear $nodeName;

//script by Paul Lohman

Any help much appreciated really, this would make my life a ton easier..