rand isn’t an expression, but a function. Try using the random float in range node, or the random int in range node. results with min and max of -1000 and 1000 respect are:
I’m trying to use a math expression node, and the random function seems to be extremely limited.
The only variant that seems to work is just basic “rand()”. It’s always a float, and you can’t define a range. The normal functions for that just aren’t recognized, like “randRange(0,1)”.
Is there any way to do this? It actually seems to be missing most functions, leading me to wonder if the node is still just a prototype, and not meant for use in actual production.
I was hoping to use it because I’m under the impression that it runs more efficiently than individual nodes.
You missed the point. I’m trying to do this through a Math Expression node, rather than just normal, individual nodes.
The Math Expression node appears to lack those variations.
It makes sense that there is no need to add every single random functions in the math expression. If you think of an interpreted language, such as javascript, it only has Math.random(). From there you can easily make the random in range for example, 5 to 8 is (5 + Math.random() * 3). Right?
Those Random in Range/Stream nodes are just there to help the user but they are all be based off the one rand() function.
In fact, if I use rand() in a Math Expression you can see that it’s bare node random float:
It’s possible I missed the point of what you were trying to express. But it’s more likely I didn’t express my point well. My point is, you’re wanting to duplicate functionality in the Math Expression node that exists as a standard node and there’s no practical reason for it.
The Math Expression node allows you to write an expression that would be a complicated node setup. It’s not intended to replace functionality that exists as a default node. If you want a random number in range to be used in your expression, you should create an input and use the random range node to generate the random number.