Levitateme
12-27-2003, 05:16 AM
I was trying to make a Hotkey like 5 so it would toggle between smoothshaded, wireframe. and later i would like to get the code and set 4 as flat shaded.
i tried this
if $TimsWireFrameToggle = 0
{
string $currentPanel = `getPanel -underPointer`;
if ("" == $currentPanel) {
$currentPanel = `getPanel -withFocus`;
}
if ("" != $currentPanel) {
string $panelType = `getPanel -typeOf $currentPanel`;
if ($panelType == "modelPanel") {
modelEditor -edit -displayAppearance "smoothShaded" -displayTextures off
-displayLights "default" $currentPanel;
} else if (`isTrue "MayaCreatorExists"` && `scriptedPanel -exists $currentPanel`
&& `scriptedPanel -query -type $currentPanel` == "dynPaintScriptedPanelType") {
dynPaintEditor -edit -displayTextures 0 -displayAppearance "smoothShaded"
-displayLights "default" $gDynPaintEditorName;
}
}
}
$TimsWireFrameToggle = 1
else
displaySmoothness -full;
{
string $currentPanel = `getPanel -underPointer`;
if ("" == $currentPanel) {
$currentPanel = `getPanel -withFocus`;
}
if ("" != $currentPanel) {
string $panelType = `getPanel -typeOf $currentPanel`;
if ($panelType == "modelPanel") {
modelEditor -edit -displayAppearance "wireframe"
-displayLights "default" $currentPanel;
} else if (`isTrue "MayaCreatorExists"` && `scriptedPanel -exists $currentPanel`
&& `scriptedPanel -query -type $currentPanel` == "dynPaintScriptedPanelType") {
dynPaintEditor -edit -displayAppearance "wireframe"
-displayLights "default" $gDynPaintEditorName;
}
}
}
$TimsWireFrameToggle = 0
;
but i get syntax errors...does anyone know how to get around this? it would be great if i could have 5 key toggle wireframe/smooth shaded and 4 toggle flat shaded/Xray...if anyone can help out that would be really great. most appreciated.
i tried this
if $TimsWireFrameToggle = 0
{
string $currentPanel = `getPanel -underPointer`;
if ("" == $currentPanel) {
$currentPanel = `getPanel -withFocus`;
}
if ("" != $currentPanel) {
string $panelType = `getPanel -typeOf $currentPanel`;
if ($panelType == "modelPanel") {
modelEditor -edit -displayAppearance "smoothShaded" -displayTextures off
-displayLights "default" $currentPanel;
} else if (`isTrue "MayaCreatorExists"` && `scriptedPanel -exists $currentPanel`
&& `scriptedPanel -query -type $currentPanel` == "dynPaintScriptedPanelType") {
dynPaintEditor -edit -displayTextures 0 -displayAppearance "smoothShaded"
-displayLights "default" $gDynPaintEditorName;
}
}
}
$TimsWireFrameToggle = 1
else
displaySmoothness -full;
{
string $currentPanel = `getPanel -underPointer`;
if ("" == $currentPanel) {
$currentPanel = `getPanel -withFocus`;
}
if ("" != $currentPanel) {
string $panelType = `getPanel -typeOf $currentPanel`;
if ($panelType == "modelPanel") {
modelEditor -edit -displayAppearance "wireframe"
-displayLights "default" $currentPanel;
} else if (`isTrue "MayaCreatorExists"` && `scriptedPanel -exists $currentPanel`
&& `scriptedPanel -query -type $currentPanel` == "dynPaintScriptedPanelType") {
dynPaintEditor -edit -displayAppearance "wireframe"
-displayLights "default" $gDynPaintEditorName;
}
}
}
$TimsWireFrameToggle = 0
;
but i get syntax errors...does anyone know how to get around this? it would be great if i could have 5 key toggle wireframe/smooth shaded and 4 toggle flat shaded/Xray...if anyone can help out that would be really great. most appreciated.
