The maxscript command for setting a grid size is setGridSpacing, so you could create a custom macroscript, something like:
if getGridSpacing() == 4.0 then setGridSpacing 8.0
else setGridSpacing 4.0
The Maxscript help files tell you how to set up a custom macroscript, from there you can bind it to a hotkey. The code I pasted above would set the space between grid lines to 8 if it was currently 4, and if it was any other value it'd get set to 4 (so would become a toggle between 8 and 4 no matter what the starting size was).
I have one at work which basically just doubles the grid spacing when ] is pressed, and halves the spacing when [ is pressed, and I just keep it all in powers of two.
thanks. i just hoped i could get around maxscript. looked through this a little, but i always get an error message. maybe you can help, as i just do some mel stuff and maxscript works a little different. probably just some mistake with the setup of macroscripts.
Oops, the setGridSpacing command is only available in Max 2008 or later, looks like you're on an earlier version, so it won't work.
Use gridPrefs.spacing instead...
if gridPrefs.spacing == 1.0 then gridPrefs.spacing = 0.1
else gridPrefs.spacing = 1.0
There's also the gridPrefs.majorLines value, sets the major line spacing to whatever number you give it. All of this is in the Maxscript Reference document, just type "grid" into the Index, you'll find all the related commands with explanations there.
great. that works now. i was actually already digging into the command reference and couldn't find the command, but thought it was some different problem.
that really helped my workflow. thanks for your fast help.
Replies
The maxscript command for setting a grid size is setGridSpacing, so you could create a custom macroscript, something like:
The Maxscript help files tell you how to set up a custom macroscript, from there you can bind it to a hotkey. The code I pasted above would set the space between grid lines to 8 if it was currently 4, and if it was any other value it'd get set to 4 (so would become a toggle between 8 and 4 no matter what the starting size was).
I have one at work which basically just doubles the grid spacing when ] is pressed, and halves the spacing when [ is pressed, and I just keep it all in powers of two.
Use gridPrefs.spacing instead...
There's also the gridPrefs.majorLines value, sets the major line spacing to whatever number you give it. All of this is in the Maxscript Reference document, just type "grid" into the Index, you'll find all the related commands with explanations there.
that really helped my workflow. thanks for your fast help.