View Full Version : hotkey toggle
designingpatrick 03-12-2010, 01:42 AM Don't hate me for the simple question.
I wanted to assign a hotkey to toggle xray mode, so I created one using the setXrayOption 1 command. But this only turns it on, how can I create a hotkey which toggles the option?
|
|
goleafsgo
03-12-2010, 01:59 AM
The only thing really complicated is that this is a per-panel setting so you have to figure which panel you want to toggle. Usually people do this by asking which panel is active, or which panel the mouse is over, then checking to make sure that it's actually a modelPanel, and then changing the setting to the opposite of what it is currently.
e.g.
{
string $panel = `getPanel -underPointer`;
if ("" != $panel && "modelPanel" == `getPanel -typeOf $panel`)
{
modelEditor -edit -xray (!`modelEditor -q -xray $panel`) $panel;
}
}
designingpatrick
03-12-2010, 02:41 AM
Great! I look forward to toggling my xray vision as well as other model panel specific things.
Thanks.
ewerybody
03-15-2010, 11:23 AM
Hello! I have this as well.
But I found it to be nice and convenient to have texture-toggle on the same hotkey when on the UVEditor:
if (`getPanel -wf` == "polyTexturePlacementPanel1")
textureWindowToggleTextureImage( "polyTexturePlacementPanel1", "textureWindow");
else
{
$curPanel = `getPanel -wf`;
if(`getPanel -typeOf $curPanel` == "modelPanel")
modelEditor -e -xray (!`modelEditor -q -xray $curPanel`) $curPanel;
else
print"toggleXRay: no model panel!\n";
}
I love context specific stuff :]
CGTalk Moderation
03-15-2010, 11:23 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-2013, Jelsoft Enterprises Ltd.