這個mel主要是用來顯示線框模式
1.wireframe_on_shaded
string $currPanel = `getPanel -withFocus`;
if ("" != $currPanel && ("modelPanel" == `getPanel -to $currPanel`))
{
int $xrayonoff = `modelEditor -q -wos $currPanel`;
switch ($xrayonoff)
{
case 0: modelEditor -e -wos true $currPanel;
break;
case 1: modelEditor -e -wos false $currPanel;
break;
default: break;
}
$wosonoff = `modelEditor -q -wos $currPanel`;
print("WireframeOnShaded: "+$wosonoff+"\n");
} else {
error "No modeling panel selected or invalid.";
}
由於maya在選取物件的時候會自動顯示線框,用上面那個mel把線框關掉,可是選去的物件線框還是會開著,有時候在做High Poly物件的時候,觀察物件時會比較不方便,所以可以利用這個mel把選取物件的線框關掉。
2.turning_off_wireframe
string $wires = `displayPref -q -wsa`;
if ($wires == "none")
displayPref -wsa "full";
else
displayPref -wsa "none";
這個是整體XRay開關的mel
3.XRay
string $panel = `getPanel -wf`;
modelEditor -e -xray ( !`modelEditor -q -xray $panel` ) $panel;
這個是單一物件的XRay開關,有時候物件需要對位的時候只打開單一物件的XRay會比較好對位置,全部一起打開反而比較難查看。
4.XRay_select
global proc r_superXray()
{
string $select[] = `ls -sl`;
int $sizes = `size$select`;
if ($sizes >= 1)
{
string $mySel[] = `ls -sl -dag -s`;
for ($s in $mySel)
{
int $xState[] = `displaySurface -q -xRay $s`;
displaySurface -xRay ( !$xState[0] ) $s;
}
}
if ($sizes < 1)
{
string $all[] = `select -ado`;
displaySurface -xRay 0;
select -cl;
$currentPanel = `getPanel -wf`;
$mode = `modelEditor -q -xray $currentPanel`;
modelEditor -edit -xray (!$mode) $currentPanel;
}
}
r_superXray;
這個是把背面顯示關掉的~可以避免選擇到背面的點。
5.BackfaceCulling
setAttr yourSelection.backfaceCulling 0;
沒有留言:
張貼留言