Home Technical Talk

Grid Editor - Maya script to quickly modify the grid settings

polycounter lvl 13
Offline / Send Message
< ASH > polycounter lvl 13

Hey guys,
On the project I am working on right now  I found myself going back and forth to the Maya Grid Options quite a lot.
After a while I found it really tedious and time consuming.
At the same time I find the window size way too big (and it also shows too many options that you set once and then you forget about): so keeping it on screen all the time was not a viable option to me.
So I looked for a script/plugin that allowed to set just the basic Grid options (the ones you use all the time): Size, Spacing and Division.

Among the scripts I found, "GridEditor" (by: Greg Hendrix aka "BlackHwk4") was my favorite one: simple, effective and its window is really small and resizable. 

The grid resizing takes place straight away: so you don't have to accept the settings like in Maya's default Grid Options (that I notices take roughly 1 second to be applied). Just hit the arrows (or type the value) and the grid will change straight away.



You can download the original version of GridEditor (has been released in 2006) from creative crash:
https://www.creativecrash.com/maya/script/grid-editor

However after testing out I found its basic settings pretty ineffective, so I decided to customize it to my needs.
The main changes I made are the following:
- Improved width and spacing of the components (some fields were too small too display the values and some text was cut off)
- Edited the values increment of the various parameters (the defaults increment were 0.1 ... way to small and useless):
* SIZE now grow/decrease of 500 units (= 500 cm = 1/2 meter)^ each time you click its arrows
* SPACING now grow/decrease of 25 units (= 25 cm = 1/4 meter)^ each time you click its arrows
* DIVISION now grow/decrease of 1 unit each time you click its arrows
^ This assuming that you keep Maya units set to centimeters

The rest of the scripts works as the original:
- you can always manually type a value to adjust it to your needs (for example a lot of time I manually tip 5 or 10 units in the spacing box when)
- the window is fully re-sizable (just drag the sides or the bottom corners) and can be re-positioned wherever you like just clicking and dragging on the window top bar (bear in mind that if the window is too small can be difficult to pick the right spot to move it, so first enlarge it a bit).


You can download the modified version of script from my Google Drive:
https://drive.google.com/file/d/1VB75yfy657_WDI2-a-3VNpjCCcC_OEiF/view?usp=sharing

You can test both the original script and my version of the script and decide which one you like more.
In case you want to have different increment settings let me know: it's pretty easy to do (mel scripts can be edited with a simple text editor).

To install the script simply copy it in the Maya scripts folder (keeping Maya closed), that usually lies in the Documents folder on your PC: \Documents\maya\version*\scripts
* version refers to your Maya version, meaning 2012, 2013, 2014, 2015, 2016, 2016.5, 2017, etc.

Then launch Maya and in the command line, select MEL and then type: gridEditor

I know it's a really simple script but I found it useful and maybe somebody else might find it useful too. :)

Replies

  • throttlekitty
    Options
    Offline / Send Message
    Nice! I was looking for something like this a few months ago. Ultimately what I ended up doing was a hotkey to toggle between the first three subdivisions of the grid, so here's that in case someone wants it:

    {

    if ( `grid -q -d` == 1 ) {

    grid -d 2;}

    else if ( `grid -q -d` == 2 ) {

    grid -d 4;}

    else if ( `grid -q -d` == 4 ) {

    grid -d 1;

    }}

  • < ASH >
    Options
    Offline / Send Message
    < ASH > polycounter lvl 13
    Nice! I was looking for something like this a few months ago. Ultimately what I ended up doing was a hotkey to toggle between the first three subdivisions of the grid, so here's that in case someone wants it:

    {

    if ( `grid -q -d` == 1 ) {

    grid -d 2;}

    else if ( `grid -q -d` == 2 ) {

    grid -d 4;}

    else if ( `grid -q -d` == 4 ) {

    grid -d 1;

    }}

    Yeah this is a valid alternative: thanks for posting it throttlekitty:smile: 
    However I find the bigger issue with it is that you are not fully aware of the subdivision level you're at (because you have no visual indicator of it) and also you don't have direct access to the subdivisions (that I keep in a different color just to be easier to spot).

    But maybe some people don't want to be bothered by a floating window and in that case your script might suit their needs. ;)


Sign In or Register to comment.