View Full Version : Plus Minus Average from Maya

12 December 2008, 10:34 AM
Hi i am Joćo Victor Ferreira, maya student, and i want make a question of maya. My book said : inputD[0] and inputD[1], but this node dont have the second value. What i have to do? Well, if somebody can help me, thanks!

Bye! :thumbsup:

Joćo Victor Ferreira

12 December 2008, 01:53 PM
You can connect stuff like that through MEL.

Like this:

connectAttr theCubeOfDoom.translate theNodeOfDoom.input3D[0];
connectAttr theConeOfDoom.translate theNodeOfDoom.input3D[1];

12 December 2008, 03:07 PM
thanks! but only mel? not by nodes?

12 December 2008, 03:09 PM
i will try! thanks!!

12 December 2008, 10:08 PM
it's a bug in the connection editor of maya thats been around for a few versions it's much quicker to do it using mel any ways once you get a hang of it.

you can also do it through the hypergraph by right clicking on the node you want to connect from on the right side and the right clicking on the node you want to connect to on the left side of node.

the connections for the inputs will show up in there. Just not in the connection editor.

you can also do it in the hypershade in a similar way.


12 December 2008, 11:34 PM
Ok! i understand! thanks very much for your help. So i think that i will not do it, because no have 2 options in the input of =-average. i should make something wrong before, because the book: body language (eric allen) say to conect input1d0 and input1d1. i have to do it to make a compressible spine. but thanks for help. i am begginning in maya.


Joćo Victor Ferreira

12 December 2008, 02:39 AM
i'm not sure if i understood you, but you do have two options it will show as [0] and [1] in the hypergraph under the right click menu under the input name (input1D[n], input2D[n], input3D[n]). if you need to use it you could simply use multiply divide node they don't bug out like the plus minus average node and will show in the connection editor and the other ways i mentioned. you can use two of them to do the same math function as average.

once you get maya's quirks you will love it

12 December 2008, 04:43 AM

Try this mel script:

setAttr plusMinusAverage1.input1D[0] 1;


"setAttr" command sets te attribute...
"plusMinusAverage1" is the name of the node...
".input1D" is the attribute...
"[0]" is an array (can go from "0" to infinity)...
"1" stands for "on" or "true"...

12 December 2008, 10:58 AM
Ok! thanks for the helps! i use multiply divide, and will try mel too. if i achieve this i return and say to you that i achieve! now, can i make a question? i dont like so much maya, but i read that this is best for character rigging, better than max. it“s true? and mel is fundamental? até mais!

Joćo Victor Ferreira

12 December 2008, 11:16 AM
all packages have strength and weaknesses just pick one and stick to it. maya is definitely the widest used. you can do just about everything with out mel if you wanted, but it is such a major speed boost and saves you days or weeks off of rigs (and everything else). Mel is also the power of maya. It's also kinda fun once you get the hang of it.

12 December 2008, 11:26 AM
ok! well, thanks for the tips Adam! até mais!
i trying the spine with new nodes! i will achieve.

Joćo Victor Ferreira

12 December 2008, 12:18 PM
Hi Adam, a node +- average enabled the second value inputD1 now!, but a make NOTHING. i think that is BUG. only the first node enabled this. the other 6 nodes have only first value inputD0.

Its possible bug?

Joćo Victor Ferreira

12 December 2008, 05:46 PM
plusMinusAverage is a bit "strange" to understand , once you start connecting your attributes ( at least i had the same strange feeling about this node , when i got to know it for the first time - as it differs a little bit from the other nodes such as multiplyDivide , addDoubleLinear or e.g. distanceBetween ) .

compared with multiplyDivide ( which explicitely multiplies 2 * 3D-values - xyz ) , the plusMinusAverage-Node is 1D , 2D and 3D ... ( e.g. if you want to connect "translate" or "rotate" information - you have to use the *.input3D[0] first , then the *.input3D[1] and so on ... you can create "additions en masse" ( e.g. a serial chain of additions ) - so it is possible to create an array of 3D-coordinates to be added together .

of course you can also use the 1D-input , if you just want to add up single values .

$node_pma = `createNode plusMinusAverage`;

// example 1D
setAttr ($node_pma + ".input1D[0]") 1;
setAttr ($node_pma + ".input1D[1]") 2;
setAttr ($node_pma + ".input1D[2]") 3;
setAttr ($node_pma + ".input1D[3]") 4;

getAttr ($node_pma + ".output1D");

// example 2D
setAttr ($node_pma + ".input2D[0].input2Dx") 1;
setAttr ($node_pma + ".input2D[1].input2Dx") 2;
setAttr ($node_pma + ".input2D[2].input2Dx") 3;

setAttr ($node_pma + ".input2D[0].input2Dy") 2;
setAttr ($node_pma + ".input2D[1].input2Dy") 4;
setAttr ($node_pma + ".input2D[2].input2Dy") 6;

// you can also set both values in one command
setAttr -type "double2" ($node_pma + ".input2D[3]") 4 8;

getAttr ($node_pma + ".output2D");

// example 3D
setAttr -type "double3" ($node_pma + ".input3D[0]") 1 2 4;
setAttr -type "double3" ($node_pma + ".input3D[1]") 2 4 8;
setAttr -type "double3" ($node_pma + ".input3D[2]") 3 6 12;

setAttr ($node_pma + ".input3D[3].input3Dx") 4 ;
setAttr ($node_pma + ".input3D[3].input3Dy") 8 ;
setAttr ($node_pma + ".input3D[3].input3Dz") 16 ;

getAttr ($node_pma + ".output3D");

think about it , is an array of additions / subtractions ... or you can have the average of all coordinates - which you connect into the inputs .

01 January 2009, 05:01 PM
Ok! Thanks for help! i will try it! bye!

01 January 2009, 11:27 PM
Thanks!! i make it !!! thanks for help! now, i have 4 channels!!

01 January 2009, 11:31 PM
But now, tha spine streched!!! thanks, i will see it!

CGTalk Moderation
01 January 2009, 11:31 PM
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.