Adverti horiz upsell
Configuring jEdit with Maya
Configuring jEdit with Maya
rbublitz, updated 2007-05-19 23:24:23 UTC 45,141 views  Rating:
(6 ratings)
Page 4 of 4

 

6. Maya code browser

A. What it does
Ever wanted a listing of all your global procedures in your script? And then list all the places where that procedure is used? How about a listing of all the string variables your script is using and where theyre used?
Well, using an existing jEdit plugin this is possible.

If you are writing Maya plugins with jEdit, you can also use this to display functions, macros, variables and Maya API objects.

B. What it needs
The plugin that makes this possible is called CodeBrowser (written by Gerd Knops). The plugin is available at www.jedit.org

CodeBrowser does it magic using another tool called Exuberant CTags available at https://ctags.sourceforge.net

As their site says:
Ctags generates an index (or tag) file of language objects found in source files that allows these items to be quickly and easily located by a text editor or other utility. A tag signifies a language object for which an index entry is available (or, alternatively, the index entry created for that object).

Tag generation is supported for the following languages:
Assembler, AWK, ASP, BETA, Bourne/Korn/Zsh Shell, C, C++, COBOL, Eiffel,
Fortran, Java, Lisp, Lua, Make, Pascal, Perl, PHP, Python, REXX, Ruby, S-Lang,
Scheme, Tcl, Vim, and YACC.

Youll notice that mel is not listed. There is another file included in the .zip file called ctags.cnf. This lists all the regular expressions that will recognize the syntax to make index tags for mel scripts. It also adds a regex for Maya plugin API objects.

C. How to set it up
a. First, download the Exuberant Ctags archive file from their site. Unzip and place the directory somewhere. I put it inside the jEdit user settings directory to make finding it easier.

b. Put the CodeBrowser.jar in the jEdit/jars/ directory

c. Put the ctags.cnf in the jEdit user settings directory (Note: this is for Windows
machines. For Linux this could be different and the file might need to be renamed
to .ctags. See the Ctags docs.)

d. Now we need to tell CodeBrowser where Ctags is. Open jEdit and go to the plugin options page:
Plugins/Plugin Options/CodeBrowser

e. In the ctags Path: text field, fill in the path to the executable you remember where you put it?

f. Restart jEdit

D. How to use
a. To bring up the window, start it from the /Plugins menu. I like to dock the
window to the bottom of jEdit. Do this by going to:
Utilities/Global Options/Docking
Find the CodeBrowser entry and select bottom. While youre at it, look for
the HyperSearchResults entry and dock it to the right.

b. The Code Browser window has two split panes. The top one is a listing of
all the scripts that are currently open. Selecting one will switch to that buffer.

c. The bottom pane lists the tags for the current buffer. For mel scripts there
will be entries for:
i. Global procedures
ii. Local procedures
iii. Var float
iv. Var integer
v. Var string
The display is current as of the last save of the file. If the file is modified,
either press Parse or save the file to automatically update the listing.

d. Right-clicking on any entry will bring up several options. The most helpful is
the Hypersearch option. Bring up the Hypersearch window to the right. Now
by selecting Hypersearch on an entry, the results will be displayed to the right.
Here you can see what lines in the script reference that entry. Selecting an
entry in the Hypersearch window will put you to that place in the script.

e. Clicking on the True checkbox in the top right corner of the Hypersearch
window will turn on Multiple entry mode. This will keep all past searches
persistant.

f. For any Maya plugin files, CodeBrowser will display Functions, Macros and
Variables. There will also be a listing for Maya Api objects that begin with
M*.