Maya-Mel

Posted by toddw on 2008-11-08 17:03 |
1.1.3
Todd Whiteman
Wed, 2013-04-24 11:51
  • : 4.4 - 8.*
  • : 4.4 - 8.*

Support for editing Maya-Mel script files within Komodo.

Features provided by this extension:

  • maps ".mel" files to the Mel language
  • syntax highlighting (colorising)
  • basic completions support on variables and built-in functions/keywords
  • commenting/uncommenting support for "//"
  • smart brace indenting
  • API Catalog for Maya (thanks to JTilden)

The source code for the extension is available at:
https://github.com/Komodo/Mel

meesto | Mon, 2008-11-10 12:35

Thank you for adding this support feature. I look forward to trying it out.

--
Chris

martin_hughes | Tue, 2009-09-08 15:20

Hi guys,

I was looking for a MEL lexer. Can you tell me what version this was designed for? I'm planning to update it for Maya 2010.

Also, how far did the codeintel implementation go? I'll update that too if necessary (beyond keywords etc.). I've grabbed the source, but it would be nice to know where I'm starting from!

Cheers,

Martin

toddw
ActiveState Staff
Tue, 2009-09-08 15:42

Hi Martin,

This extension was written to support the Maya Embedded Language (Mel). I don't know if anything has changed to Mel with the Maya 2010 release - nor the particular version of the keywords/builtins used by this extension.

The Mel codeintel system provides automatic completions on variables and built-in functions/keywords. You can see these in the file:
http://svn.openkomodo.com/openkomodo/view/addons/maya/pylib/lang_mel.py

Cheers,
Todd

martin_hughes | Tue, 2009-09-08 23:40

Thanks Todd!

It seems that I won't have to change much - you normally get a few keywords added between Maya versions. I've got the list from the 2010 docs.

Also MEL has "nodes" (from the dependency graph) which may or may not be useful to have highlighted in the syntax. I'll add them and see if I get more or less confused ;)

I'm also going to look at a way of "sending" the MEL to Maya directly from Komodo (without having to save a MEL file or copy/paste into the MEL editor in Maya. Maya has a reasonable Python implementation (which MEL can be called from) so it shouldn't be too hard.

Cheers,

Martin

toddw
ActiveState Staff
Wed, 2009-11-04 11:41

There is now a Maya API catalog included in the extension, which was generated by JTilden, see here:
http://community.activestate.com/forum/maya-python-cix-extension

Cheers,
Todd

meesto | Mon, 2009-12-14 13:44

I've just updated to your Maya 1.1.1 extension on OS X 10.5.8/Komodo 5.2.3, but I still can not get auto-completions for Maya Python commands to work. Mel seems to be just fine.

I've put a check mark in the code-intelligence preferences for Maya API, have restarted Komodo and still no joy.

I wish I could figure out where the Maya extension is actually being placed on my Mac - it does not appear to be any place obvious.

Chris

toddw
ActiveState Staff
Mon, 2009-12-14 15:43

The extension will be installed into your Komodo profile:
http://community.activestate.com/faq/komodo-profile-structure

the actual API catalogs file will be inside the "host-YOURHOST/XRE/extensions/maya@activestate.com/apicatalogs" filder.

Cheers,
Todd

meesto | Mon, 2009-12-14 20:05

Thanks for those links. That is very helpful.

toddw
ActiveState Staff
Mon, 2009-12-14 15:45

You may also want to check that Komodo has a valid interpreter set in Komodo's "Languages->Python" preferences as well, as that needs to be set before Python completions can be shown.

Cheers,
Todd

meesto | Mon, 2009-12-14 20:17

Yes (on Mac OSX 10.5.8) I have it set to "Find on Path" or "/usr/local/bin/python" and in either case the Feature Control Panel shows that Python is ready for both debugging and syntax checking.

Python completions *are* working for native Python, but are not working for Maya beyond the top level cmds, mel, app, etc... As was mentioned earlier by someone else I get the same results when I "import maya.cmds as cmds" - if I then type "cmds." I get nothing - no suggestions of possible substructure at all.

I'll go and check this under Windows now.

Kind regards,
Chris

Lizard Lounge Graphics
http://www.lizardlounge.com

meesto | Mon, 2009-12-14 21:42

If you define an additional Python Import Directory in the Python Preferences (eg. /Applications/Autodesk/maya2010/.../python2.6/site-packages) then these seem to take preference over the the Maya 1.1.1 extension you've created. When I removed the libraries which point to the Maya Python references of the same name (cmds, app, mel, etc...) the code completion works as one would expect it to.

If I uninstall the Maya 1.1.1 extension and point to the Maya Python site-packages then it goes back to only loading the top level items.

Whew.

Kind regards,
Chris

Lizard Lounge Graphics
http://www.lizardlounge.com

pyrokinesis | Mon, 2009-12-14 22:28

Awesome!

Thanks Chris.

picrots | Wed, 2013-04-24 01:03

nice work but it looks it's not compatible with komodo 8

toddw
ActiveState Staff
Wed, 2013-04-24 11:52

Thanks for the note, I've bumped compatibility to support Komodo 8.