Featured Articles
Stitch
Rhythmic Walk
Major Project - Divine Application
Generi Rig for Blender
KWrite/Kate MEL Syntax Highlighting
Improving the Maya Linux File Browser
Latest News
Search

KWrite/Kate MEL Syntax Highlighting PDF

ImageThe odds are that if you've ever done any serious MEL coding, then you'll know just how terrible Maya's script editor is. For writing short scripts it's not too bad, but for any script that's longer than about a hundred lines, it quickly starts to chafe. I've recently started using Kate and KWrite on Linux for my MEL scripting, and they're actually very nice. However, the lack of syntax highlighting started to irritate me... If it irritates you too, then read on

 

Syntax highlighting in Kate is controlled through XML files. Your typical Kate XML syntax file has three parts - keyword lists, grammar rules, and highlighting styles. The keywords and grammar rules are used to mark regions of the document as "being of a particular style", so for example "all lines that start with // are in a block called 'Line Comments' ". You can then tell Kate to draw all 'Line Comments' blocks using a 'Line Comment' style which you specify as part of your highlighting block at the end of the XML file. If you feel like creating your own XML syntax file (it's ok, we've all been there at some point in our lives!), then a good place to start is looking at the ones that come installed with Kate. There's also some documentation about it on their website (although if you're thick like me then you might need to re-read it a few times before you understand what they're getting at).

If all this sounds like Norwegian to you, then don't fret, because I've done all the hard work for you. Simply download this XML file, and save it in "~/.kde/share/apps/katepart/syntax/" . Once you've done this, close all open documents in Kate/KWrite, close it, and restart it. Open a file with the ".mel" extension, and the editor should automatically pick up that it's a MEL script, and highlight it accordingly.

If you feel like customising the highlighting a bit, then you can do it all from within Kate - go to the menu and choose "Settings->Configure Kate" (or "Settings->Configure Editor" in KWrite). Choose "Fonts and Colors" in the dialog that pops up, and then select the "Highlighting Text Styles" tab. From here, you can edit the style the editor uses for any part of the MEL syntax. Hooray - complete control, and no awkward text file editing!

Image

 

 

Designed by: Drupal hosting Mambo templates Best web hosting
http://www.kreanimate.co.uk/site, Powered by Joomla and designed by SiteGround web hosting