Message 1 of 3
Not applicable
04-30-2020
07:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All! I am a python/maya programming n00b, (mostly stay on the art side of things) but I'm needing to write a script to make my life a little easier for a project I'm working on. Currently I have a script that calls these items:
cmds.modelEditor("modelPanel1", edit=True, grid=0);
cmds.modelEditor("modelPanel2", edit=True, grid=0);
cmds.modelEditor("modelPanel3", edit=True, grid=0);This simply turns off the grid in the given viewports. Works great. But what I would like to do is have it "check" said viewports and simply invert the state it's currently in. So if the grid is turned off, it turns it on. If it's on, it turns it off. I know I should use the "if" functions, but what I'm not clear on is what syntax to use to query the state of the grid/on off via python in Maya? Thanks for any help!
Solved! Go to Solution.