Finding vertex groups in maya.

So a while ago a friend of mine, Perry Leijten, asked me to help out with seemingly a simple problem for his awesome skinning tools.

*Which you can find here btw:

The problem being:

“I want to sort my selection of vertices in groups.”

i.e. all neighboring vertices in separate groups.

Simple enough i thought and had a crack at it.

Lots of hair later, 4am, birds chirping and I had a working version… that being immensely slow. After some tinkering and brainstorming we had a version that could do vertex sorting on a 40k vertex mesh in about 1 second.

This got implemented in his skinning tools. Now about 6 months later I revisited the problem and got a speed improvement of about 70%. Sooo I thought it would be nice to make a post about it.

Hopefully the comments in the code speak for themselves.

If not and you have any questions feel free to ask in the comments.

To test it do the following:

1. Create a poly sphere in maya .

2. set it to 200×200 subdivisions

3. run the script


MEL Autocompletion for Sublime and MayaSublime

Justin Israel made an awesome extension for the Sublime Text editor called MayaSublime.

But I noticed there is no auto completion file for the MEL syntax so I decided to generate one.

This contains all MEL commands that I can find. Half of these are generated by the help of the Maya help command:
help -list “*”

The rest is generated by parsing all the MEL scripts and taking all “global procs” in the Maya installation scripts folder.

Hope this is of some help to people still having to manage legacy MEL scripts ^^.

I also added the script that I wrote to generate this which might be useful if you are working in a different version of Maya than this file is generated from. (Maya 2014)

Feel free use edit and or modify these files in any way you see fit.

The zip file contains the MEL.sublime-completions and the Python file used to generate this file.

SublimeAutoComplete  < CLICK HERE >

(links dont show up properly yet XD)

Copy the MEL.sublime-completions here:

C:\Users\<userName>\AppData\Roaming\Sublime Text 3\Packages\MayaSublime

If you want to generate this file do the following steps:

1) Copy the into your scripts folder.

2) C:\Users\<UserName>\Documents\maya\<Maya Version>\scripts

3) Load up maya.

4) open the script editor

5) type:


mayaOnly = This will export only maya commands and scripts that are in the install folder ( C:\Program Files\Autodesk\<mayaVersion>\scripts)

Setting this to False will look in all possible scripts paths defined in the environment variable called: MAYA_SCRIPT_PATH

apiOnly = only generate the commands that are listed in the maya command reference.

filePath = The file path the document will be exported to. i.e. C:\MEL.sublime-completions

If you leave the filePath argument out of it then it will export to the default sublimeText3 mayaSublime folder if it exists:

C:\Users\<userName>\AppData\Roaming\Sublime Text 3\Packages\MayaSublime

It will try to detect your user name automatically.



Mel and Python do go hand in hand at times.

Seeing as some developers still work with mel and a lot of legacy scripts within companies are still written and maintained in mel its sometimes useful to call python functions in mel when having to extend those old legacy scripts. now most people know you can do a:

inside of mel.

But I recently found a mel wrapper function that does this for you!!! And not only that it also adds the proper from module import function path as well!

So this is actually quite usefull so i thought i’d share it here:

for example. Let say you have the following python script that connects two attributes.

Save this to a file and store it somewhere in the maya scripts paths.

(i.e. my s\Documents\maya\2014-x64 )

Now import the script:

This will run the script and as I added a print it will output the actual code it evaluates:

and now you can go to mel and do:

*note i added the “rehash” to make sure the mel scripts are refreshed.


If you want to get more information about this wrapper function run the following lines inside of a python tab in maya:

Or take a look here:,topicNumber=d30e727627


Save out vertex colors from Houdini.

Someone asked me how to export vertex colors from Houdini.

So I gave it a quick go to see how rusty my houdini had become and turns out it was horrifically rusty.

Anyway without further ado … here   is the script and otl.

Mind that the otl is made in the learning edition.



Python reload all. Well … kind of

Do you also hate adding a

while developing a new tool.
If yes then here is the solution:

This removes all initilised modules from the memory. Even the ones that are loaded using the


This means python will have to reload all modules. So put those few lines at the top of your project and you dont have to worry about reloading your modules while you are developing them. 😀

(Yes i know hacky as hell, but then again thats why we are tech artists :D)

Script: Saving shader information

A while ago I was asked to make a example script of how you could save out shader data. The main reason for this was to find out which textures are used for which channel. This way you do not have to use naming conventions but just have the script grab all the info you need.