Hey guys,
I am an advanced maya user, however I just started learning mel about a week ago, so bare with me please!
I am trying to write a basic script that will select all nurbs curves in the scene regardless of the curve names, and set their translate/roation attributes to zero. There is more to the script... sadly that is the part I am stuck on. The naming error keeps getting in the way. This is what I have so far:
{
string $nurbs[] = ls -type nurbsCurve -v
;
int $i;
for( $i = 0; $i < size $nurbs
; $i++ )
{
setAttr ($nurbs[0] + ".translateX") 0;
setAttr ($nurbs[0] + ".translateY") 0;
setAttr ($nurbs[0] + ".translateZ") 0;
}
}
It returns and error saying "No object matches name". I am confused, because the following script does exactly what I want it to do, just without the loop:
{
string $sphere[] = sphere
;
setAttr ($sphere[0] + ".scaleY") 13;
print ($sphere[0] + ".scaleY" + "\n");
}
If i take the above script, and replace sphere with ls -type nurbsCurve -v
, i get the same " No object matches name" error.
Help please!!