Archive for the ‘Uncategorized’ Category

First, some whinging

Saturday, May 14th, 2011

I know, MEL is just a scripting language, intended to afford convenient access to the Maya motherbrain, and it isn’t a robust or versatile alternative to C++ or Python, both of which I’ll probably have to learn in order to bend Maya to my will. Still. It’s missing features even JavaScript had back in the day. It’s like they made it intentionally awkward.

1) It’s strongly typed. Half my time is spent tracking down type mismatch errors. If I’d grown up programming like the Amish, who shun you for seven times seven days if you allow data of different types to touch, maybe this would come more naturally to me, but I think an app like Maya should be able to see the connection between a vector and any other three floats in a row.

2) No nested arrays. Can’t do it. Not allowed. You can have a matrix, which is a nested array, but not a dynamic matrix, meaning you must specify the size of a matrix beforehand, and you can’t change the size after you’ve made it. Shouldn’t this just be an extra letter in a source code file somewhere? Another loop?

3) Weak array handling. MEL has some built-in array-manipulating procedures — but for arrays of strings, only.

4) PolyInfo string. Why does the polyInfo command return everything in a giant concatenated string, which must then be tokenized to be of any use? I smell laziness.

5) Normals. To get the normal of a face, you have to dig it out of the polyInfo string. Okay, whatever. But the thing it doesn’t tell you, and the docs don’t tell you, and I’ve never seen mentioned in any of the threads on any of the forums where this question comes up, is that the returned value assumes the face in question is at the origin, with no applied rotation or scale. So if you actually want the normal normal, you have to do another little dance to get it.

These things may just be part of the arcane, occult knowledge previously only available to initiates of the Maya cult, but now I’m putting them here, out in public, where Google can see them. I am also hoping that I’m just missing something obvious, which will be pointed out by someone in the know.