View Full Version : view3d.showGrid Toggle Button?
Jiokah 08-28-2009, 01:21 PM Hey Guys,
Trying to learn modo...
I'm trying to make the G button toggle between the grid being on or off, and I'm not really sure how to make that happen. Since the view3d.showGrid command has only true or false arguments, pressing the G key could either only turn the grid off or only turn it on, not both depending on it's original state. How do I get around that?
Thanks guys :)
|
|
SreckoM
08-28-2009, 05:52 PM
Well, you could use if statement to check current state. Something like this, I didn't try this so please see if this is working.
#perl
if (lxq("view3d.showGrid ?") eq 0){
lx("view3d.showGrid true");
}else{
lx("view3d.showGrid false");
}
Jiokah
08-29-2009, 05:15 AM
Woo! Thanks dude. Took me a while to figure out what to do with that little bit of code there, but it works wonderfully now.
I saved your script as a file, put it in the scripts folder, then spent about half an hour trying to figure out how to map a script to a key, turns out the "script.implicit" command was what I was looking for. Just went into input editor and mapped "script.implicit toggleGrid.pl" to the G key.
Thanks again
-Matthew
SreckoM
08-29-2009, 07:33 AM
Save the script in Scripts folder, and name it as 'gridToggle.pl'. And than add is as command like this: '@gridToggle.pl' without quotes, and assign to it key stroke.
CGTalk Moderation
08-29-2009, 07:34 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.