PDA

View Full Version : State of the Maya?


Omita
12-03-2009, 07:08 PM
So, I haven't coded in Maya in about 2 years due to a career shift (other programming). There was a pet project that I had forgotten about and I wanted to wrap it up. I even missed the whole Autodesk buying SoftImage...

Anyway... when I left the industry Python was supported in Maya 8.5 and 2009 but very few production companies were coding tools in Python due to it being slower and so much of the companies scripts already being coded in Mel. In addition, if your idea's were getting too big for Mel you needed to write an C++ plug-in, which had some Cross-platform woes.

Has this changed? Or is Maya 8 still found in many production houses (Game Studios) thus Mel is still king? Or are more companies switching their tools to Python?

I've never ramped up on Python but I like the idea of being able to move away from Mel's procedural code. I ended up learning a lot of XSI scripting at the time because XSI had better baking and rendering support.

Feel free to PM me if you can't share your opinion over the forums.

Chadrik
12-04-2009, 02:29 AM
when you know python you'd rather jab out your eyes with a rusty nail than write MEL. one of my main motivators in writing pymel was simply my extreme desire to never write another line of MEL again. but hey, i may be a little biased. :)

kojala
12-04-2009, 07:58 AM
Agree with Chadrik. :)

Havent tried pyMel yet, but python alone works ALOT better than mel.
specially string manipulation and not to mention data types that
mel doesnt have like sets and dictionarys

Mark-J
12-04-2009, 08:17 AM
There's still alot of mel around, mainly because large studios such as ourselves have so much legacy code and toolsets in Mel. We're gradually replacing / updating everything and all new tools are in Python. We're making more and more use of pymel, thanks Chad, why the hell didn't Autodesk make thier python integration more object based.

Mark

Robert Bateman
12-04-2009, 03:56 PM
Chad, why the hell didn't Autodesk make thier python integration more object based.


Maya as a whole is starting to show it's age a bit, that's all....

Maya's DG is Object Based, as is the API, but neither of those things contains the ability to perform undo. That's mel's job (and the reason that mel isn't OOP).

The problem is that mel was intended as a journaling service to provide an undo mechanism for maya. So, each mel command is an atomic operation that responsible for it's own undo/redo implementation.....

So, with this in mind... would you rather implent undo for this:

setAttr

or this:

class Transform
{
void setTX(); //< this needs undo
void setTY(); //< so does this
void setTZ(); //< and this

void setRX(); //< and this
void setRY(); //< ditto
void setRZ(); //< hoepfully

void setSX(); //< you get
void setSY(); //< the idea
void setSZ(); //< by now.....
};

// now imagine doing that for every single Maya Node.....


Mel is actually hierarchical, i.e.


proc myFunc() //<undo step "myFunc" stored
{
setAttr thing.tx 0; //< undo step "myFunc.setAttr" stored
setAttr thing.ty 0; //< undo step "myFunc.setAttr" stored
setAttr thing.tz 0; //< undo step "myFunc.setAttr" stored
}

Which is how they implement the ability to undo any mel script, and the reason why you'll never have an OOP version of mel.

It's also fair to say that mel actually is very OOP, if you conasider it in context. Maya's DG provides an OOP like data structure with more powerful OOP features than C++ itself provides. If you store *all* of your data in the DG (i.e. avoid variables in mel, and use nodes+attrs instead) then it's actually more powerful than python is....

Once you get your head around that fact, you start to enjoy using mel quite a bit....

Chadrik
12-04-2009, 06:47 PM
It's also fair to say that mel actually is very OOP, if you conasider it in context. Maya's DG provides an OOP like data structure with more powerful OOP features than C++ itself provides. If you store *all* of your data in the DG (i.e. avoid variables in mel, and use nodes+attrs instead) then it's actually more powerful than python is....


that's not MEL being OO, that's simply MEL interacting with Maya's nodes, which use OO-style inheritance, but you can do the same thing in python, so i'm not sure how that makes MEL more OO than python....

Buexe
12-06-2009, 07:14 AM
I dont understand all this MEL bashing I hear these days ...
It works, maybe outdated, maybe has it flaws, but gets the friggin job done in many cases, so what? Many Python scripts kids I hear will give you vague arguments why Python is so hot and then dont have the API knowledge to go in the fast lane.

Chadrik
12-07-2009, 03:08 PM
what makes python better than mel is not necessarily that it is OO. the single biggest reason that python is superior to MEL as a language can be given with one word: dictionaries. and the second reason: multi-dimensional arrays. 90% of the ridiculous contortions that are so common in MEL are due to the absence of these two things.

however, the single biggest reason for anyone to switch to python is actually something else entirely: standard and third-party modules. I tell my TD's that the first thing you should do before writing something from scratch is ask the question "is this remotely interesting to the general python community?". if the answer is "yes", then there is a very good chance that the module already exists. connecting to a database, data serialization, writing and reading common formats like xml csv xls, parsing html, regular expressions, system info, cross-platform path parsing, ui building, version control (cvs, git, mercurial). and let's not forget one very important set of modules: maya.cmds, maya.mel, maya.OpenMaya, maya.OpenMayaAnim, etc.

all of these reasons make python vastly superior to MEL and i have not even begun to touch on object-oriented programming.

ewerybody
12-08-2009, 08:48 AM
Word buexe!!! I always need some kind of killer application. And so far there was no task that I couldn't do in MEL. So I sticked with it. And its still cool I think.
Of course python is a standard. I really should start working with it. But I'm in the same position Mark-J describes: Our toolset in Maya is MEL only. So when I get a task: Its done in MEL. It works well. So I don't see where its SO crappy. One can code bad in any language.

But word@Chadrik as well: I sometimes miss multidimensionArrays. But I yet don't know about the benefits of pythons dictionaries. But yes python IS more straightforward. for sure.

So @Omita: if you starting over. Why not use python!? It will probably be worth to dig into it.

Buexe
12-09-2009, 06:28 AM
To be honest I dont think that it is worth spending time on the discussion which thing is superior. Clearly it is python as it allows you to do some stealth ninja power moves on the DG that the oracles of the older gods would definitely disapprove. I finally had some time exploring scripted plug-ins and find it to be very nice and flexible. But then also a serpent god can bleed as it also has some limitations and is slow compared to c++ ( even the API version). But for some reason usually you dont hear it a lot since currently many people ride the python train and suggest that it is ultima ratio. Working in Maya is about creating nodes setting attributes and connecting nodes. MEL does this well and can do even more on top of that. And as I have been using Vicon Blade the last year I apprecciate it even more, since I can script there in MEL, too. And multi-dimensional arrays are doable btw but I will keep that trick for me until the python army confronts me at the hot gates.

This...... is .......... MMAAYYYAAA!

(Buexe kicks the Python messenger into the abyss)
Cheers, guys!

CGTalk Moderation
12-09-2009, 06:28 AM
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.