這是同事在公司寫的melscript,主要是給lighter設定不同組的shader參數,上面有三組分別為huge,normal跟tiny的shader參數可以選擇,三組個別有不同的specular跟bump的shader參數
global proc jingubang_selector(string $phase)
{
string $a = `slimcmd slim GetAppearances -name "Spec_jingubang"`;
string $b = `slimcmd slim GetAppearances -name "disp_jingubang"`;
string $c;
$a = `slimcmd $a GetProperties -name "Intensity"`;
$c = `slimcmd $b GetProperties -name "displacementbound"`;
$b = `slimcmd $b GetProperties -name "Kb"`;
if ($phase == "huge")
{
slimcmd $a SetValue 1.000;
slimcmd $b SetValue 0.0008;
slimcmd $c SetValue 0.0015;
}
if ($phase == "normal")
{
slimcmd $a SetValue 5.000;
slimcmd $b SetValue 0.015;
slimcmd $c SetValue 0.030;
}
if ($phase == "tiny")
{
slimcmd $a SetValue 1.000;
slimcmd $b SetValue 0.0015;
slimcmd $c SetValue 0.0030;
}
deleteUI -window ABCWin;
}
global proc surface_jingubang_selector()
{
if (`window -ex ABCWin`==true)
deleteUI -window ABCWin;
window -title "Selct Jingubang Size" ABCWin;
columnLayout -adjustableColumn 1;
button -label "Huge" -c "jingubang_selector(\"huge\")";
separator -h 10;
button -label "Normal" -c "jingubang_selector(\"normal\")";
separator -h 10;
button -label "Tiny" -c "jingubang_selector(\"tiny\")";
setParent ..;
showWindow ABCWin;
}
surface_jingubang_selector();
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言