Home Technical Talk

MEL in Maya LT rant

polycounter lvl 6
Offline / Send Message
bitinn polycounter lvl 6
Hi,

This is a rant, so posting here instead of Tech Talk.

Hope someone can prove me wrong, but after using MEL for some days, I am now pretty convinced that MEL is a horrible scripting language, no language I used before even come close, that's including some ancient PHP / Javascript.

Is it true that:

- You cannot breakdown a long script into multiple files without using global procedures (no namespace, no export, all pollution).

- You must structure your script in a way that every reference to a local proc must be defined already. (Note "reference", not "call". It means you have to put shorter, likely helper functions, at the front of script.)

- Once you source a global procedure, it stays there for the entire session. (Impossible to clean up or debug without restart Maya).

- And it's the only language I used that does not have a specification.

I am not going to mention language features, because anyone can tell its lacking...

/rant over

I am curious: Maya LT users, do you use MEL scripts in your daily life? Have you ever attempt to see what's in your MEL script?

Replies

  • throttlekitty
  • [Deleted User]
    Options
    Offline / Send Message
    [Deleted User] insane polycounter
    The user and all related content has been deleted.
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    http://help.autodesk.com/view/MAYAUL/2017/ENU/?guid=__files_API_Introduction_htm

    I always thought of Mel as a little fun tool for quick scripts to help me do some repetitive stuff.  The heavy stuff happens through the API which can talk to maya in Mel, Python or C++.  Maybe look into that for "some days".
    Oh yeah, totally, if I am on Maya I would totally look at that.

    But I am on Maya LT.



  • [Deleted User]
    Options
    Offline / Send Message
    [Deleted User] insane polycounter
    The user and all related content has been deleted.
  • Meloncov
    Options
    Offline / Send Message
    Meloncov greentooth
    Yeah, scripting in MayaLT is fairly limited. That's by design.
  • Aabel
    Options
    Offline / Send Message
    Aabel polycounter lvl 6
    This right here is one of the chief reasons I took a pass on MayaLT. Of all the things they can take out that an "indie DEVELOPER" won't need Python and api access are actually kind of critical.
  • Pandan
    Options
    Offline / Send Message
    Pandan polycounter lvl 7
    Maya LT is the most buggy mess i've ever had the displeasure of using.
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    In case people are interested, try figuring out this:

    http://polycount.com/discussion/190643/mel-mystery-series#latest

    And by the way, this language is not limited, it is just confusing as hell.
  • Fansub
    Options
    Offline / Send Message
    Fansub sublime tool
    It really sucks that Maya LT doesn't have Python support :( MEL is indeed quite the "cheap" programming language, wouldn't recommend it for anything too complex (unless,like me, you're into self pain infliction).

    I've gotten used to the global procedure workflow of it. Just always make sure that your procedure has a very specific name in order to avoid collision with other tools. I've never had an issue with it so far so yeah i think it's mainly an issue of getting used to it.

    Dunno if you already did but you should definitely rant on the Autodesk forums and ask for Python support ;-)
  • radiancef0rge
    Options
    Offline / Send Message
    radiancef0rge ngon master
  • RyanB
    Options
    Offline / Send Message
    I've found that 99.9% of the problems I run into with programming are my own mistakes or lack of experience. 
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    RyanB said:
    I've found that 99.9% of the problems I run into with programming are my own mistakes or lack of experience. 
    Enjoy your cool and non-dismissive response ;)

    Do see my other thread above if you want to double-confirm if it's 100% my fault :)
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    Fansub said:
    It really sucks that Maya LT doesn't have Python support :( MEL is indeed quite the "cheap" programming language, wouldn't recommend it for anything too complex (unless,like me, you're into self pain infliction).

    I've gotten used to the global procedure workflow of it. Just always make sure that your procedure has a very specific name in order to avoid collision with other tools. I've never had an issue with it so far so yeah i think it's mainly an issue of getting used to it.

    Dunno if you already did but you should definitely rant on the Autodesk forums and ask for Python support ;-)
    Global procedure is unavoidable anyway because UI command requires global proc.

    My real complain is really global variables. Anything not in the block {} is default global, and they stays forever in the Maya session. So while debugging if you happen to use a global variable by mistake you have to restart Maya or try to overwrite it.

    I will get back to you on the refactored Quick Pipe script :)
  • Fansub
    Options
    Offline / Send Message
    Fansub sublime tool
    My real complain is really global variables. Anything not in the block {} is default global, and they stays forever in the Maya session. So while debugging if you happen to use a global variable by mistake you have to restart Maya or try to overwrite it.
    Hm i see this as a non-issue tbh :p at first yes it's annoying, but then you get used to putting two brackets to your code anyway. MEL really is "special" in every possible way, and it's way of dealing with variable is awful when compared to, say Python for ex.

    Best of luck in your MEL adventure, and can't wait for the Quick Pipe refactored thingy (thanks a lot for that !) :)
  • claydough
    Options
    Offline / Send Message
    claydough polycounter lvl 10
    mel does have some pluses to it ( not that something modern is not in order but I could say the same for all dcc apps )
    Considering Maya is built on top of it's internal collection of mel scripts...
    That mel script's folder and your text editor's find in file function is Maya's secret innards documentation in combination with "echo all commands". I don't know of any scripting language that allows as much unintentional behind the curtains detective possibilities and surgery?

    Have you tried leveraging the scope of a variable inside and outside of braces to your advantage? 
    As far as debugging global variables without restarting Maya...
    have you tried find/or mark and copy pasting a debugging naming convention instead of restarting.

    Have you leveraged global variables persistence during a session as a utility strategy for all your scripts?
    ( I have found I am often trying to always do a variation of the same thing when I create a global variable. Enough times that I call a utility script instead now...
    that handles global variables "universally" instead of from within whatever tool I am currently working on. Where that tools unique needs may call for extending the utilities features/abilities but hardly ever necessitating that a need to bypass as much with a new global variable from that new script? )
Sign In or Register to comment.