PDA

View Full Version : connectAttr -na prb (multiple inputs)


pixho
11-20-2002, 10:00 AM
Hi all,

I remember an old thread about the difference of the Maya4.0 and Maya4.5 with the connectAttr -na (nextAvailable) to a plusMinusAverage
If you have multiple inputs to connect to a PMA node, we used to do connectAttr -f -na input1.color to pma.input3D, and so on for the other inputs

This doens't work out anymore in Maya4.5 as mentionned in a previous post by a user (sorry if I don't remember its author ;-))

I ran into the same prb with the subSurfIllum script, so apparently, the way we have to do now is to get the size of the size inputs (how many inputs is there to connect) and connect them successively to the node like so:

string $input[] = `ls -sl`; // selected nodes are the inputs
int $inputSize = `size $input`; // how many inputs are there
for ($i = 0; $i < $inputSize; $i++)
connectAttr -f ($input[$i] + ".outColor") plusMinusAverage.input3D[$i];

It works fine this way (or other syntaxes in mel)

I agree with the user who noticed that, it's a bit surprising, but I guess it's now more handy to make connections this way, because you can set the order of the inputs (before one couldn't)

Let me know what you think of guys...


I have updated (not online yet) the surbSurfIllum and I'll update my other scripts in order to make them work correctly with this behavior


Emmanuel

CGTalk Moderation
01-13-2006, 06:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.