Share this post

Link to post

Share on other sites

Vex is a highly multi threaded language, I think adding try-catch/except logic would seriously slow it down.
most value errors at least, will just return 0, as VEX is strongly typed. (like Atom Mentioned)

Rather than crashing the node, its probably better to compare your values to 0 in some cases (and if the expected value is non-0)

Share this post

Link to post

Share on other sites

I don't have issues with division by 0 and I get you remark about optimization- I was just wondering if there was some way of doing this that I was missing..

My main issue is with variable types and functions/nodes that might break due to have a bad evaluation. and as far I as know I can't do a check on the variable type, neither create a variable with auto, so I was just checking if I can assess it another way around, by letting it fail, but do something else when it fails.

Take this example, float array[] = set(value) will work for all the non-array float composites, float, vector3, vector4, matrix3, matrix4. But...

But... it doesn't work with Vector2 or Matrix2.

Which is an alternative route already because something like matrix + 1 doesn't work (adding 1 to each component), so I decided to flatten all out into an array of floats and iterate over them. But even that doesn't work with all types :/

If I could check for variable type I could do something else for vector2 and matrix2. This because I'm trying to build overload nodes.
I also don't see a way to build a function with signatures, do I need to use HDK for that?

I'm all over the place, but I'm trying to find the best way to go about maximizing an operation to the maximum number of data types...