Community
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add more Math (trig) Nodes

Add more Math (trig) Nodes

(Copied from original User Voice forum)

 

"Currently there are basic math nodes, but it would nice to have more advanced ones built in. I have seen many TD's create their own, myself included, but they are so easy why not do it yourselves? Having them built in will avoid having to compile for other platforms or distributing them, the less dependencies the better."

 

"http://www.cgdna.com/web/mathematic-nodes-main"

 

"This is what I've been cooking and re-cooking for years, as have a number of different people: 
http://www.thejaco.com/wp/tools/rf_mathnodes/ 
Get in touch if you want the source, but frankly speaking just tell any developer over there "it's a wrap of cmath" and they will know exactly what it is, and that it only takes a couple hours to implement the lot.

It's such an important yet trivial set of operations there's no reason to prioritize, all of cmath is in the standard library for a reason 🙂"

 

"Fixing quaternion functions (quaternions don't have cross product).

Constants 
E 
PI 
TWO_PI 
INV_PI 
SQRT_TWO 
EPSILON 
INFINITY 
More...

Basic Types 
Float 
Vector 
Color 
Quaternion 
Matrix

Basic Arithmetic Operations 
Addition 
Subtraction 
Multiplication 
Division

Mathematical Functions 
Nth Power 
Nth Root 
Modulo 
Minimum 
Maximum 
Factorial 
Exponential 
Logarithm 
Floor 
Ceil 
Truncate 
Sign 
Round 
Absolute

Geometric Functions 
Sine 
Cosine 
Tangent 
Cotangent 
Secant 
Cosecant 
Arcsine 
Arccosine 
Arctangent 
Arccotangent 
Arcsecant 
Arccosecant 
Hyperbolic Sine 
Hyperbolic Cosine 
Hyperbolic Tangent 
Hyperbolic Cotangent 
Hyperbolic Secant 
Hyperbolic Cosecant 
Hyperbolic Arcsine 
Hyperbolic Arccosine 
Hyperbolic Arctangent 
Hyperbolic Arccotangent 
Hyperbolic Arcsecant 
Hyperbolic Arccosecant

Vector Functions 
Cross 
Dot 
Normalize 
Magnitude 
Rotate 
Rotate By Quaternion

Color Functions 
Clamp 
Luminance 
More...

Quaternion Functions 
Dot 
Normalize 
Magnitude 
Conjugate 
Inverse

Matrix Functions 
Inverse 
Transpose 
Determinant

Conversion Functions 
Euler To Quaternion 
Quaternion To Euler 
More...

Custom Nodes 
Expression 
Plot (2D and 3D)"

8 Comments
mischakolbe1
Participant

Can't stress enough how much this would be appreciated!

As Trevor said; it's nothing fancy or impossible to do. But a set of well defined operations would be bliss! "Well defined" as in:

  • same input/output plug names for every node (inputX, inputY, inputZ - or any other convention)
  • all nodes (that make sense) have 3D input & output (unlike multDoubleLinear vs multiplyDivide)

 

Potentially even 1 nodeType for each operation. That way they stay as efficient as possible.

jwlove
Advocate

This is exceptionally important for rigging and would help clean up node networks while also making them easier to follow.  The current selection of math nodes is something I've just kind of hobbled along with for so many years... Since I started watching the "Cult of rig" series on youtube, my desire for a better suite of math nodes is almost unbearable.  There are so many users making these nodes for themselves and it would be exceptionally helpful if Maya just had them (it's kind of crazy that it doesn't have them yet).  EVERYONE would benefit.

 

I would also like to see nodes with inputs/outputs types specified in a way that it does not need to create unitConversion nodes.  As a breif example, I'll take a look at multDoubleLinear (and really, it would be good if these new nodes were handled this way "across the board"):

 

multiplyDivide is nice, but there are times where you only need one input/output set (ie: like you're only using input1X/input2X/outputX) and so using a multDoubleLinear is amazing!  The unitConversion nodes get in the way if you're plugging in rotations, so a "multDoubleAngle" would be great to have as well (and the other operations, of course).

 

There may also be situations where your inputs are doubleAngle, and your output should be doubleLinear or vice versa, so nodes that internally convert it would be beneficial as well such as a "multDoubleAngleToDoubleLinear" or something along those lines... 

 

I think separating out the operations into different nodes is a good idea rather than an enum for operations.  For example, there is the multDoubleLinear, but it would also be nice to have a "divideDoubleLinear" node too - as well as corresponding nodes for the other operations.  Sure this would make a LOT of new nodes, but you would be able to more quickly tell what the node is supposed to do AND it will hopefully evaluate faster since it would be very specialized.

 

I would also like to see each operation have 3 different nodes with slightly different inputs/outputs:

- single (input1, input2, output)

- triple (input1X, input1Y, input1Z, etc)

- open ended array (input[0].input1, input[0].input2, output[0], etc)

the idea with the last one is sometimes I'm using a multiplyDivide node and have 4 or more items to multiply, so I have to split them up 3 and 1 or 2 and 2 onto two separate nodes, where it would be much cleaner to have the single node.

 

To clarify, I know I've written a lot about the multiplyDivide stuff, but I'm asking for this across all the math nodes: multiply, divide, nth power, nth root, add, subtract, average, absolute value, clamp min only, clamp max only, clamp min and max, sine, cosine, tangent, etc, etc, etc...

 

Lastly, I want to echo the request of the inputs/outputs having a consistent naming convention across these nodes.  It's aggravating having to look up what they're supposed to be if you are writing a script and you don't remember - "is this xyz or rgb?"  "Is it input1 and input2 or input0 and input1?"  "Is it input or inputValue?"  ugh

 

Thanks!

mischakolbe1
Participant
In case you're interested in making the aggravating inputs & outputs and
scripting a ton of setAttrs and all that a bit more intuitive, maybe check
out this;
https://vimeo.com/242716233
That's exactly why I made this script and it makes creating node-setups
quite fun. v2 on its way, which will be even more versatile.
jwlove
Advocate

That's extremely clever Mischa, and I can see it being exceptionally helpful - especially the tracer print out so you can get the bare minimum commands for a script that loops through many many nodes.

 

I've written my own wrapper functions around many of maya's default math nodes to create them and connect/set their plugs... and in doing that, I synced up the arg names for inputs and outputs (for the most part); however, with mine, if I create a node and all the necessary plugs for connecting inputs and outputs don't exist yet, I have to manually build the plug string when passing it as an input for another of my wrapper functions.  So, I still have to look them up, but not as often...

 

Your tool definitely takes care of that headache and some others!  Armed with more/cleaner math nodes, this would be even better.  Thanks for sharing - would it be worth trying to get it incorporated into maya as well (perhaps as a different suggestion)?

mischakolbe1
Participant

Thanks a ton, @jwlove!

More and cleaner math nodes would definitely boost the usefulness of this script. As many mentioned before; most studios have their own library, but it would be great if all this could be much more standardized. Especially if tools like the NodeCalculator could then build upon those standard nodes.

 

I went ahead and created a separate suggestion. Let's see if this catches on, I'd certainly be delighted.

jwlove
Advocate

I had another thought about this - perhaps the math nodes could be written as a standard Maya plugin similar to what was done with the decomposeMatrix node?  A single "math nodes suite" plugin with a robust math node library!

 

I don't know if this is better than being part of the core of maya or not... but I can see how it would be a way to maybe back-port the nodes to a few previous versions of Maya by users being able to download them directly from Autodesk.  If these are added soon, perhaps they could be auto-loaded in the current version of Maya but not in the others (obviously), while still giving relatively easy access to them.

jwlove
Advocate

Has this reached enough votes to be up for review yet?  I see several suggestions that have almost half the votes (or even less) of this one and are 'under review' while this is still stuck at 'gathering support'

 

I could be wrong, but I think it would be relatively quick to create a new suite of math nodes... probably a few days, but maybe a week at most?

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Autodesk Design & Make Report