Viewport commands

hello all. i have a simple problem. i want to make hotkeys that affect viewport specific commands. for example, the show menu; show surf, curves, etc, etc. but i can't find the mel command to apply it to the active view. what i'm thinking is that it's a call to see which view is active? anyway...

i hate having to turn off the same things, and turn them all on again, it's time consuming, and i know there's a way to do that. any help would be so much appreciated! farewell, and thanks for scanning your eyes across these letters of mine.

modelPanel#;

# being the window you're on.

open your script editor, echo all commands. right click in each window and read the script. the panel you're on is at the end of the list.

m.koperwas

thanks for the reply, i wasn't clear enough in the last post, sorry. what i mean is, i want to make a hotkey, that i push, and whichever view i'm in, i'll be able to show surf,curves,etc in that view.
i'm not a programmer, but i'm thinking there's a way to query, and assign a value to a view, then perform the command on whichever view it returns? is this right?
this is the last element of the interface that i haven't been able to customize to my liking, thanks for any help.

Hi !

I had the same problem (look my toggle xray question), now I found a solution for the
panel query problem. Look the online docs for "getPanel" command with flags either
"-wf" for last focused panel or "-up" for panel under pointer.

string $panelQuery = getPanel -wf`;

Never stop thinking, the Koernel !!!

thanks man, that's exactly what i needed. i found that command, but didn't know how to implement it so that i could put other commands to the result. thanks, you've helped a lot.

you'll need to do a bit of scripting. just to leave which viewport you want open.

my advice (and what i did for myself): don't make it a button. make it a hotkey, or series of hotkeys.

wireframe on shaded for me is ctrl- (off ctrl-alt-)
ghost mode ctrl-] (off ctrl-alt-])

get the idea? let me know if you have issues.

m.koperwas

Just by chance I recently posted a How-To about a very similar topic to this:


How do I determine the name of the camera for the currently active layout panel?

I'll (soon) post an extension/addendum to this for toggling panel visibility settings.

--
Bryan Ewert

--
Bryan Ewert

Now available on-line:

How do I get and set the