Hi guys,
I really hope someone can help me out with this little script.
I have about 50 remapColor nodes in Maya connected to shaders. My idea is to adjust
all the curvers of those nodes with a mel script so that I don’t have to go through them 1 at a time.
I thought the for-in loop would do the trick and this is what I came up with:
$value = 0.361;
string $selectionRemapC[] = ls -sl ;
for ($eachMember in $selectionRemapC)
{
setAttr ($selectionRemapC[] + “.red[1].red_FloatValue”) $value;
}
With that little piece I get the error:
// Error: setAttr ($selectionRemapC[] + “.red[1].red_FloatValue”) $value;
//
// Error: Line 6.27: Syntax error //
And when I change the code to this: (
$value = 0.361;
string $selectionRemapC[] = ls -sl ;
for ($eachMember in $selectionRemapC)
{
setAttr ($selectionRemapC[1] + “.red[1].red_FloatValue”) $value;
}
It does not give me an error but now it only adjusts nummer ‘1’ in the arrary and does not cycle
through all of the selected nodes.
Could someone please help me get around this ‘problem’? I really do not feel like
adjusting all those remapColor nodes by hand.
Kind regards,
Jason.