更新日志:
-v0.01
-v0.02
Mel腳本展示
if(`window -ex tapWin`)
{deleteUI tapWin;}
//New window
window
-menuBar true
-t "一鍵工具箱_v0.02"
-wh 200 300
-s 0 tapWin;
menu
-label "Help"
-helpMenu true;
menuItem
-label "About the Plugin"
-command "AboutHelp";
columnLayout -adjustableColumn true;
//add iconButton
iconTextButton
-en true
-style "iconAndTextVertical"
-w 100
-h 50
-image1 "channelBoxSlow.png"
-label " 1?? 一鍵解鎖"
-command "yjjs";
iconTextButton
-en true
-style "iconAndTextVertical"
-w 100
-h 50
-image1 "WireFrame.png"
-label " 2?? 一鍵隱藏(ctrl+H)"
-command "yjyc";
iconTextButton
-en true
-style "iconAndTextVertical"
-w 100
-h 50
-image1 "channelBoxUnknownSpeed.png"
-label " 3?? 角色陰影層設(shè)置"
-command "chaShadow";
iconTextButton
-en true
-style "iconAndTextVertical"
-w 100
-h 50
-image1 "channelBoxUnknownSpeed.png"
-label " 4?? 場景陰影層設(shè)置"
-command "bgShadow";
window -e -wh 200 300 tapWin;
showWindow tapWin;
//Use script
global proc yjjs()
{
string $OneTap[] = `ls -selection`;
for($AllObject in $OneTap)
{
setAttr ($AllObject+".overrideDisplayType") 0;
}
}
global proc yjyc()
{
string $TwoTap[] = `ls -selection`;
for($AllObjectTwo in $TwoTap)
{
setAttr ($AllObjectTwo+".visibility") 0;
}
}
global proc AboutHelp()
{
confirmDialog
-title "注意土思!"
-message "先選擇物體再執(zhí)行插件"
-button "Yes";
}
global proc chaShadow()
{
string $FourTap[] = `ls -selection`;
for($AllObjectFour in $FourTap)
{
SpreadSheetWindow;
setAttr ($AllObjectFour+".castsShadows") 1;
setAttr ($AllObjectFour+".receiveShadows") 0;
setAttr ($AllObjectFour+".primaryVisibility") 0;
}
}
global proc bgShadow()
{
string $FiveTap[] = `ls -selection`;
for($AllObjectFive in $FiveTap)
{
SpreadSheetWindow;
setAttr ($AllObjectFive+".castsShadows") 0;
setAttr ($AllObjectFive+".receiveShadows") 1;
setAttr ($AllObjectFive+".primaryVisibility") 1;
}
}
Mel腳本展示
if(`window -ex tapWin`)
{deleteUI tapWin;}
//New window
window
-menuBar true
-t "一鍵工具箱_v0.01"
-wh 200 300
-s 0 tapWin;
menu
-label "Help"
-helpMenu true;
menuItem
-label "About the Plugin"
-command "AboutHelp";
columnLayout -adjustableColumn true;
//add button
button
-w 180
-h 50
-label "一鍵解鎖"
-command "yjjs";
button
-w 180
-h 50
-label "一鍵隱藏(ctrl+H)"
-command "yjyc";
window -e -wh 200 300 tapWin;
showWindow tapWin;
//Use script
global proc yjjs()
{
string $OneTap[] = `ls -selection`;
for($AllObject in $OneTap)
{setAttr ($AllObject+".overrideDisplayType") 0;}
}
global proc yjyc()
{
string $TwoTap[] = `ls -selection`;
for($AllObjectTwo in $TwoTap)
{setAttr ($AllObjectTwo+".visibility") 0;}
}
setAttr "pCube1.visibility" 1;
global proc AboutHelp()
{
confirmDialog
-title "注意!"
-message "先選擇物體再執(zhí)行插件"
-button "Yes";
}
//Autodesk Maya 2018
//