Home Technical Talk

Getting started with MEL scripting in Maya

HomeGrownHeroz
polycounter lvl 6
Offline / Send Message
HomeGrownHeroz polycounter lvl 6
So after recently viewing some of Tor Fricks workflow, I really want to try and customize my workflow to really speed up production. I've often used hotkeys before but not in the way that I've recently seen most effective.

A good example is how in Tors get faster with modo tutorial, he has hot keyed the ability to bevel and then using the Shift-, and Shift-. keys to increase and decrease in edges within the bevel.

I've been experimenting with similar things in Maya and am basically trying to find the correct mel code to add or decrease the edges when adding an edge loop. I can see when increasing the Divisions input there is code generated in the script editor.

setAttr "polySplitRing45.divisions" 1.5;

How would I go about finding out how to increase or decrease the edge loops using mel code? Tor explained that he tweaked the code so could it look something similar to this in Maya?

setAttr "polySplitRing.divisions" +1;

Is there any particular good reading material that is suited to what I am trying to accomplish in general?

Thanks for reading and any help given.

Replies

  • claydough
    Offline / Send Message
    claydough polycounter lvl 10
    If I were to make the same tool I would be starting off with a lot of assumptions that I would hope was the easiest route and required very little error checking. Otherwise as much might be more involved when ctrl mmb'ing the attr in question in the viewport ( The Maya Way ) is probably what u want ( gives u the same functionality if u don't fight it )

    with polySplitRing make sure multi cut is on or 1 for interactively adding/decreasing division attribute in this way.

    If u have maya 2016 u don't need the channel box to mmb drag functionality ( adding the ctrl modifier simply gives u more precision u don't have to use it ) as it has the quick edit boxes that pop up and let u drag values n dissapears after focus change.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    I'd go for python script instead. Same commands available but you gain a lot more general python functionality. Such as handling strings, lists, etc.

    Here's a good guide for getting started.
    http://www.chadvernon.com/blog/resources/python-scripting-for-maya-artists/
  • oglu
  • antweiler
    Offline / Send Message
    antweiler polycounter lvl 8
    If your after really small shortcuts, like the one derived from the script editor, i would stick with MEL. The (only) good thing is, that everything is printed into the script editor.
    Go for it, you will quickly be able to drastically speed up your workflow.
    As soon as you start serious scripting with concatenation, loops and functions, etc I recommend the switch to Python.
Sign In or Register to comment.