Contact shadow in arnold for Maya



1.include shadow casting objects and recieving objects in a new render layer

2.shadow casting objects (primary visibility off)
NOTE: Applying a default shader with no spec and reflection would speed up the render

3.Apply " aiAmbientOcclusion1 " to the shadow recieving objects.

4. Set the desired values to the occlusion node.

5. Select the shadow recieving object and in shape node of the mesh, scroll to arnold tab and uncheck visible in diffuse attibute.

6. if there are lot of shadow recieving objects in your scene use the mel script to do the job.


//Render Stats set English&ÖÐÎÄ////////////////////////////////////////////////
// write by wangqiang , email: wq_816816@163.com 2015.4.03
//
//modify:2015.4.03

/////°ïÖú´°¿Ú

global proc HelpWindow_CH()
{
if(`window -ex HelpWindow`)
deleteUI HelpWindow;

window
-t "Help"
-maximizeButton false
-minimizeButton true
-sizeable false
-resizeToFitChildren false
-menuBar false
-menuBarVisible false
HelpWindow;
columnLayout -adj 1;


scrollLayout -horizontalScrollBarThickness 0 -h 140;
text "\n\²Ù×÷·½·¨£ºÑ¡ÔñÐèÒªÉèÖõÄÎïÌåÄ£ÐÍ£¬Ö´ÐÐÏëÒªµÄ²Ù×÷¼´¿É. ";
text -l "=====================================";
separator;
separator;
text "Ö§³ÖµÄäÖȾÆ÷£ºSoftware & mental ray & Arnold. ";
text -l "=====================================";
separator;
separator;

text "\n\QQ:531430847";
text "\n\E_mail:wq_816816@163.com";

setParent ..;

showWindow HelpWindow;
}

////////////Ó¢ÎÄ°ïÖú/////////////

global proc HelpWindow()
{
if(`window -ex HelpWindow`)
deleteUI HelpWindow;

window
-t "Help"
-maximizeButton false
-minimizeButton true
-sizeable false
-resizeToFitChildren false
-menuBar false
-menuBarVisible false
HelpWindow;
columnLayout -adj 1;


scrollLayout -horizontalScrollBarThickness 0 -h 220;
text "\n\[Work Flow]: ";
text "\n\Step 1. Select scene model you want to set. ";
text "Step 2. Set options as needed(On/Off) .";
text -l "=====================================";
separator;
separator;
text "[Support for rendering]£º";
text "\n\Software & mental ray & Arnold. ";
text -l "=====================================";
separator;
separator;

text "\n\QQ:531430847";
text "\n\E_mail:wq_816816@163.com";

setParent ..;

showWindow HelpWindow;
}





//äÖȾÏÔʾ


global proc PrimaryVisibility0()
{
string $sel[0];//¶¨ÒåÁËÒ»¸öÃû³ÆΪ$selµÄÊý×é
$sel = `ls -sl -dag -type shape`; //$sel=Ñ¡ÔñµÄÎïÌ壬shape
for ($one in $sel) //¶Ô$selÖÐËùÓÐÖ´ÐÐ
if(`objExists ($one+".primaryVisibility")`)
{setAttr ($one+".primaryVisibility") 0;}

print $sel"äÖȾ²»¿É¼û£»\n";/////melÖгöÏÖ\nµÄ²Ù×÷ºÍ»Ø³µÒ»Ñù
}

global proc PrimaryVisibility1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".primaryVisibility")`)
{setAttr ($one+".primaryVisibility") 1;}
print $sel"äÖȾ¿É¼û£»\n";/////melÖгöÏÖ\nµÄ²Ù×÷ºÍ»Ø³µÒ»Ñù
}

/////ͶÉäÒõÓ°Casts Shadows
global proc CastsShadows1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".castsShadows")`)
{setAttr ($one+".castsShadows") 1;}
print $sel"ͶÉäÒõÓ°£»\n";
}
global proc CastsShadows0()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".castsShadows")`)
{setAttr ($one+".castsShadows") 0;}
print $sel"²»Í¶ÉäÒõÓ°£»\n";
}

/////½ÓÊÕÒõÓ°ReceiveShadows

global proc ReceiveShadows1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".receiveShadows")`)
{setAttr ($one+".receiveShadows") 1;}
print $sel"½ÓÊÕÒõÓ°£»\n";
}
global proc ReceiveShadows0()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".receiveShadows")`)
{setAttr ($one+".receiveShadows") 0;}
print $sel"²»½ÓÊÕÒõÓ°£»\n";
}

//·´ÉäÖпɼûVisibleInReflections

global proc VisibleInReflections1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".visibleInReflections")`)
{setAttr ($one+".visibleInReflections") 1;}
print $sel"·´ÉäÖпɼû£»\n";
}
global proc VisibleInReflections0()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".visibleInReflections")`)
{setAttr ($one+".visibleInReflections") 0;}
print $sel"·´ÉäÖв»¿É¼û£»\n";
}

/////ÕÛÉäÖпɼûVisibleInRefractions

global proc VisibleInRefractions1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".visibleInReflections")`)
{setAttr ($one+".visibleInRefractions") 1;}
print $sel"ÕÛÉäÖпɼû£»\n";
}
global proc VisibleInRefractions0()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".visibleInReflections")`)
{setAttr ($one+".visibleInRefractions") 0;}
print $sel"ÕÛÉäÖв»¿É¼û£»\n";
}


/////Ô˶¯Ä£ºýMotionBlur

global proc MotionBlur1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".motionBlur")`)
{setAttr ($one+".motionBlur") 1;}
print $sel"Ô˶¯Ä£ºý£»\n";
}
global proc MotionBlur0()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".motionBlur")`)
{setAttr ($one+".motionBlur") 0;}
print $sel"²»²ÎÓëÔ˶¯Ä£ºý£»\n";
}


/////»Ö¸´È«²¿ÉèÖÃ

global proc RestoreSettings()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".primaryVisibility")`)
if(`objExists ($one+".castsShadows")`)
if(`objExists ($one+".receiveShadows")`)
if(`objExists ($one+".visibleInReflections")`)
if(`objExists ($one+".visibleInReflections")`)
if(`objExists ($one+".motionBlur")`)
{




setAttr ($one+".primaryVisibility") 1;
setAttr ($one+".receiveShadows") 1;
setAttr ($one+".castsShadows") 1;
setAttr ($one+".visibleInReflections") 1;
setAttr ($one+".visibleInRefractions") 1;
setAttr ($one+".motionBlur") 1;
setAttr ($one+".smoothShading") 1;
setAttr ($one+".doubleSided") 1;
setAttr ($one+".opposite") 1;
//ÒƳý¸²¸Ç
editRenderLayerAdjustment -remove ($one+".primaryVisibility");
editRenderLayerAdjustment -remove ($one+".receiveShadows");
editRenderLayerAdjustment -remove ($one+".castsShadows");
editRenderLayerAdjustment -remove ($one+".visibleInReflections");
editRenderLayerAdjustment -remove ($one+".visibleInRefractions");
editRenderLayerAdjustment -remove ($one+".motionBlur");
editRenderLayerAdjustment -remove ($one+".smoothShading");
editRenderLayerAdjustment -remove ($one+".doubleSided");
editRenderLayerAdjustment -remove ($one+".opposite");
}
print $sel"»Ö¸´Ä¬ÈÏÉèÖã»\n";
}

//////mr

////FinalGatherCast
global proc mFinalGatherCast0()
{
string $sel[0];//¶¨ÒåÁËÒ»¸öÃû³ÆΪ$selµÄÊý×é
$sel = `ls -sl -dag -type shape`; //$sel=Ñ¡ÔñµÄÎïÌ壬shape
for ($one in $sel) //¶Ô$selÖÐËùÓÐÖ´ÐÐ
if(`objExists ($one+".miFinalGatherCast")`)
{setAttr ($one+".miFinalGatherCast") 0;}

print $sel"²úÉúFGÕÕÃ÷£»\n";/////melÖгöÏÖ\nµÄ²Ù×÷ºÍ»Ø³µÒ»Ñù
}

global proc mFinalGatherCast1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".miFinalGatherCast")`)
{setAttr ($one+".miFinalGatherCast") 1;}
print $sel"²»²úÉúFGÕÕÃ÷£»\n";/////melÖгöÏÖ\nµÄ²Ù×÷ºÍ»Ø³µÒ»Ñù
}
////FinalGatherReceive
global proc mFinalGatherReceive0()
{
string $sel[0];//¶¨ÒåÁËÒ»¸öÃû³ÆΪ$selµÄÊý×é
$sel = `ls -sl -dag -type shape`; //$sel=Ñ¡ÔñµÄÎïÌ壬shape
for ($one in $sel) //¶Ô$selÖÐËùÓÐÖ´ÐÐ
if(`objExists ($one+".miFinalGatherReceive")`)
{setAttr ($one+".miFinalGatherReceive") 0;}
print $sel"½ÓÊÕFGÕÕÃ÷£»\n";/////melÖгöÏÖ\nµÄ²Ù×÷ºÍ»Ø³µÒ»Ñù
}

global proc mFinalGatherReceive1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".miFinalGatherReceive")`)
{setAttr ($one+".miFinalGatherReceive") 1;}
print $sel"²»½ÓÊÕFGÕÕÃ÷£»\n";/////melÖгöÏÖ\nµÄ²Ù×÷ºÍ»Ø³µÒ»Ñù
}

////Visible In Transparency
global proc mTransparencyCast0()
{
string $sel[0];//¶¨ÒåÁËÒ»¸öÃû³ÆΪ$selµÄÊý×é
$sel = `ls -sl -dag -type shape`; //$sel=Ñ¡ÔñµÄÎïÌ壬shape
for ($one in $sel) //¶Ô$selÖÐËùÓÐÖ´ÐÐ
if(`objExists ($one+".miTransparencyCast")`)
{setAttr ($one+".miTransparencyCast") 0;}
print $sel"͸Ã÷¿É¼û£»\n";/////melÖгöÏÖ\nµÄ²Ù×÷ºÍ»Ø³µÒ»Ñù
}

global proc mTransparencyCast1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".miTransparencyCast")`)
{setAttr ($one+".miTransparencyCast") 1;}
print $sel"͸Ã÷²»¿É¼û£»\n";/////melÖгöÏÖ\nµÄ²Ù×÷ºÍ»Ø³µÒ»Ñù
}


////Transmit Transparency
global proc mTransparencyReceive0()
{
string $sel[0];//¶¨ÒåÁËÒ»¸öÃû³ÆΪ$selµÄÊý×é
$sel = `ls -sl -dag -type shape`; //$sel=Ñ¡ÔñµÄÎïÌ壬shape
for ($one in $sel) //¶Ô$selÖÐËùÓÐÖ´ÐÐ
if(`objExists ($one+".miTransparencyReceive")`)
{setAttr ($one+".miTransparencyReceive") 0;}
print $sel"ÏÔʾ͸Ã÷£»\n";/////melÖгöÏÖ\nµÄ²Ù×÷ºÍ»Ø³µÒ»Ñù
}

global proc mTransparencyReceive1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".miTransparencyReceive")`)
{setAttr ($one+".miTransparencyReceive") 1;}
print $sel"²»ÏÔʾ͸Ã÷£»\n";/////melÖгöÏÖ\nµÄ²Ù×÷ºÍ»Ø³µÒ»Ñù
}




////Trace Reflection
global proc mReflectionReceive0()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".miReflectionReceive")`)
{setAttr ($one+".miReflectionReceive") 0;}
print $sel"ÏÔʾ·´É䣻\n";
}

global proc mReflectionReceive1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".miReflectionReceive")`)
{setAttr ($one+".miReflectionReceive") 1;}
print $sel"²»ÏÔʾ·´É䣻\n";
}


////Transmit Refraction
global proc mRefractionReceive0()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".miRefractionReceive")`)
{setAttr ($one+".miRefractionReceive") 0;}
print $sel"ÏÔʾÕÛÉ䣻\n";
}

global proc mRefractionReceive1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".miRefractionReceive")`)
{setAttr ($one+".miRefractionReceive") 1;}
print $sel"²»ÏÔʾÕÛÉ䣻\n";
}

/////»Ö¸´mentalrayÉèÖÃ

global proc mRestoreSettings()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".miFinalGatherCast")`)
if(`objExists ($one+".miFinalGatherReceive")`)
if(`objExists ($one+".miTransparencyCast")`)
if(`objExists ($one+".miTransparencyReceive")`)
if(`objExists ($one+".miReflectionReceive")`)
if(`objExists ($one+".miRefractionReceive")`)

{
setAttr ($one+".miFinalGatherCast") 1;
setAttr ($one+".miFinalGatherReceive") 1;
setAttr ($one+".miTransparencyCast") 1;
setAttr ($one+".miTransparencyReceive") 1;
setAttr ($one+".miReflectionReceive") 1;
setAttr ($one+".miRefractionReceive") 1;

//ÒƳý¸²¸Ç
editRenderLayerAdjustment -remove ($one+".miFinalGatherCast");
editRenderLayerAdjustment -remove ($one+".miFinalGatherReceive");
editRenderLayerAdjustment -remove ($one+".miTransparencyCast");
editRenderLayerAdjustment -remove ($one+".miTransparencyReceive");
editRenderLayerAdjustment -remove ($one+".miReflectionReceive");
editRenderLayerAdjustment -remove ($one+".miRefractionReceive");

}
print $sel"»Ö¸´mentalrayĬÈÏÉèÖã»\n";
}



///ArnoldÉèÖÃ///////////////////////////////////////////////////////////////////

////SelfShadows
global proc aiSelfShadows0()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".aiSelfShadows")`)
{setAttr ($one+".aiSelfShadows") 0;}
print $sel"¹Ø±Õ×ÔÉíÒõÓ°£»\n";
}

global proc aiSelfShadows1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".aiSelfShadows")`)
{setAttr ($one+".aiSelfShadows") 1;}
print $sel"¿ªÆô×ÔÉíÒõÓ°£»\n";
}

////Opaque
global proc aiOpaque0()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".aiOpaque")`)
{setAttr ($one+".aiOpaque") 0;}
print $sel"¼ÆËã͸Ã÷£»\n";
}

global proc aiOpaque1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".aiOpaque")`)
{setAttr ($one+".aiOpaque") 1;}
print $sel"²»¼ÆËã͸Ã÷£»\n";
}

////VisibleInDiffuse
global proc aiVisibleInDiffuse0()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".aiVisibleInDiffuse")`)
{setAttr ($one+".aiVisibleInDiffuse") 0;}
print $sel"²»²ÎÓëÂþÉä¼ä½ÓÕÕÃ÷£»\n";
}

global proc aiVisibleInDiffuse1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".aiVisibleInDiffuse")`)
{setAttr ($one+".aiVisibleInDiffuse") 1;}
print $sel"²ÎÓëÂþÉä¼ä½ÓÕÕÃ÷£»\n";
}

////VisibleInGlossy
global proc aiVisibleInGlossy0()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".aiVisibleInGlossy")`)
{setAttr ($one+".aiVisibleInGlossy") 0;}
print $sel"²»²ÎÓë·´Éä¼ä½ÓÕÕÃ÷£»\n";
}

global proc aiVisibleInGlossy1()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`;
for ($one in $sel)
if(`objExists ($one+".aiVisibleInGlossy")`)
{setAttr ($one+".aiVisibleInGlossy") 1;}
print $sel"²ÎÓë·´Éä¼ä½ÓÕÕÃ÷£»\n";
}

/////»Ö¸´ARÉèÖÃ

global proc AiRestoreSettings()
{
string $sel[0];
$sel = `ls -sl -dag -type shape`; //ÁгöÑ¡ÔñÎïÌå
for ($one in $sel)
if(`objExists ($one+".aiSelfShadows")`)
if(`objExists ($one+".aiOpaque")`)
if(`objExists ($one+".aiVisibleInDiffuse")`)
if(`objExists ($one+".aiVisibleInGlossy")`)


{
setAttr ($one+".aiSelfShadows") 1;
setAttr ($one+".aiOpaque") 1;
setAttr ($one+".aiVisibleInDiffuse") 1;
setAttr ($one+".aiVisibleInGlossy") 1;


//ÒƳý¸²¸Ç
editRenderLayerAdjustment -remove ($one+".aiSelfShadows");
editRenderLayerAdjustment -remove ($one+".aiOpaque");
editRenderLayerAdjustment -remove ($one+".aiVisibleInDiffuse");
editRenderLayerAdjustment -remove ($one+".aiVisibleInGlossy");

}
print $sel"»Ö¸´mentalrayĬÈÏÉèÖã»\n";
}


////////////////////////ÖÐÎÄ´°»§//////////////////////////////////////////////////////////////////////////////
//´°¿Ú³ÌÐò


global proc RenderStats_CH(){



if(`window -exists RenderStats`) deleteUI RenderStats;

windowPref -ra;

window -wh 270 235 RenderStats;

columnLayout -adj true ;




/////°ïÖú´°¿Ú
string $menuBarLayout = `menuBarLayout`;
menu -label "Help";
menuItem -label "English / ÖÐÎÄ" -c "RenderStats";
menuItem -label "¹ØÓÚ" -c "HelpWindow";

separator;




//UI
string $tabs = `tabLayout -w 270 -h 235`;

string $MyTab1 = `scrollLayout -horizontalScrollBarThickness 0`;


///MAYAÉèÖÃ


/////äÖȾÏÔʾPrimary Visibility

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;

text -bgc 1 0.4 0.4 PrimaryVisibility;
button -l "äÖȾÏÔʾ" -h 24 -c "PrimaryVisibility1";
button -bgc 0 0.7 0.7 -l "äÖȾ²»ÏÔʾ" -h 24 -c "PrimaryVisibility0";
setParent ..;

/////ͶÉäÒõÓ°Casts Shadows

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;

text -bgc 1 0.4 0.4 CastsShadows;
button -l "ͶÉäÒõÓ°" -h 24 -c "CastsShadows1";
button -bgc 0 0.7 0.7 -l "²»Í¶ÉäÒõÓ°" -h 24 -c "CastsShadows0";
setParent ..;

/////½ÓÊÕÒõÓ°ReceiveShadows

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 ReceiveShadows;
button -l "½ÓÊÕÒõÓ°" -h 24 -c "ReceiveShadows1";
button -bgc 0 0.7 0.7 -l "²»½ÓÊÕÒõÓ°" -h 24 -c "ReceiveShadows0";
setParent ..;

/////·´ÉäÖпɼûVisibleInReflections

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;

text -bgc 1 0.4 0.4 V_InReflections;
button -l "·´ÉäÖпɼû" -h 24 -c "VisibleInReflections1";
button -bgc 0 0.7 0.7 -l "·´ÉäÖв»¿É¼û" -h 24 -c "VisibleInReflections0";
setParent ..;

/////ÕÛÉäÖпɼûVisibleInRefractions

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;

text -bgc 1 0.4 0.4 V_InRefractions;
button -l "ÕÛÉäÖпɼû" -h 24 -c "VisibleInRefractions1";
button -bgc 0 0.7 0.7 -l "ÕÛÉäÖв»¿É¼û" -h 24 -c "VisibleInRefractions0";
setParent ..;

/////Ô˶¯Ä£ºýMotionBlur
rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;

text -bgc 1 0.4 0.4 MotionBlur;
button -l "Ô˶¯Ä£ºý" -h 24 -c "MotionBlur1";
button -bgc 0 0.7 0.7 -l "Ô˶¯²»Ä£ºý" -h 24 -c "MotionBlur0";
setParent ..;

/////»Ö¸´È«²¿ÉèÖÃRestoreSettings
rowColumnLayout -nc 3 -cw 1 90 -cw 2 160 -cw 3 150;

text -bgc 1 0.4 0.4 RestoreSettings;
button -bgc 0 0.7 0.7 -l "»Ö¸´È«²¿ÉèÖÃ" -h 24 -c "RestoreSettings";

setParent ..;
setParent ..;

/////MR

///MentalrayÊôÐÔÉèÖÃ


/////FinalGatherCast

string $MyTab2 = `scrollLayout -horizontalScrollBarThickness 0`;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 FG_Cast;
button -l "²úÉúFGÕÕÃ÷" -h 24 -c "mFinalGatherCast1";
button -bgc 0 0.7 0.7 -l "²»²úÉúFGÕÕÃ÷" -h 24 -c "mFinalGatherCast0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 FG_Receive;
button -l "½ÓÊÕFGÕÕÃ÷" -h 24 -c "mFinalGatherReceive1";
button -bgc 0 0.7 0.7 -l "²»½ÓÊÕFGÕÕÃ÷" -h 24 -c "mFinalGatherReceive0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 VisbleIn_Tr;
button -l "͸Ã÷¿É¼û" -h 24 -c "mTransparencyCast1";
button -bgc 0 0.7 0.7 -l "͸Ã÷²»¿É¼û" -h 24 -c "mTransparencyCast0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 Transmit_Tr;
button -l "ÏÔʾ͸Ã÷" -h 24 -c "mTransparencyReceive1";
button -bgc 0 0.7 0.7 -l "²»ÏÔʾ͸Ã÷" -h 24 -c "mTransparencyReceive0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 TraceReflection;
button -l "ÏÔʾ·´Éä" -h 24 -c "mReflectionReceive1";
button -bgc 0 0.7 0.7 -l "²»ÏÔʾ·´Éä" -h 24 -c "mReflectionReceive0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 TransmitRefraction;
button -l "ÏÔʾÕÛÉä" -h 24 -c "mRefractionReceive1";
button -bgc 0 0.7 0.7 -l "²»ÏÔʾÕÛÉä" -h 24 -c "mRefractionReceive0";
setParent ..;


/////»Ö¸´mentalrayÉèÖÃ
rowColumnLayout -nc 3 -cw 1 90 -cw 2 160 -cw 3 150;
text -bgc 1 0.4 0.4 MR_RestoreSet;
button -bgc 0 0.7 0.7 -l "»Ö¸´mentalrayÉèÖÃ" -h 24 -c "mRestoreSettings";


setParent ..;
setParent ..;
/////ArnoldÊôÐÔÉèÖÃ
string $MyTab3 = `scrollLayout -horizontalScrollBarThickness 0`;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 SelfShadows;
button -l "¿ªÆô×ÔÒõÓ°" -h 24 -c "aiSelfShadows1";
button -bgc 0 0.7 0.7 -l "¹Ø±Õ×ÔÒõÓ°" -h 24 -c "aiSelfShadows0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 Opaque;
button -l "¼ÆËã͸Ã÷" -h 24 -c "aiOpaque0";//·´½á¹û
button -bgc 0 0.7 0.7 -l "²»¼ÆËã͸Ã÷" -h 24 -c "aiOpaque1";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 VisibleInDiffuse;
button -l "²ÎÓëÂþÉäÕÕÃ÷" -h 24 -c "aiVisibleInDiffuse1";
button -bgc 0 0.7 0.7 -l "²»²ÎÓëÂþÉäÕÕÃ÷" -h 24 -c "aiVisibleInDiffuse0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 VisibleInGlossy;
button -l "²ÎÓë·´ÉäÕÕÃ÷" -h 24 -c "aiVisibleInGlossy1";
button -bgc 0 0.7 0.7 -l "²»²Î·´ÉäÕÕÃ÷" -h 24 -c "aiVisibleInGlossy0";
setParent ..;


rowColumnLayout -nc 3 -cw 1 90 -cw 2 160 -cw 3 150;

text -bgc 1 0.4 0.4 RestoreSettings;
button -bgc 0 0.7 0.7 -l "»Ö¸´ArnoldÉèÖÃ" -h 24 -c "AiRestoreSettings";

setParent ..;






//±êÒ³
tabLayout -edit
-tabLabel $MyTab1 "MAYAÊôÐÔÉèÖÃ"
-tabLabel $MyTab2 "MRÊôÐÔÉèÖÃ"
-tabLabel $MyTab3 "ArÊôÐÔÉèÖÃ"


$tabs;

showWindow RenderStats_CH;
}




//////

//´°¿Ú³ÌÐò
////////////////////////Ó¢ÎÄ´°»§//////////////////////////////////////////////////////////////////////////////

global proc RenderStats(){



if(`window -exists RenderStats`) deleteUI RenderStats;

windowPref -ra;

window -wh 200 235 RenderStats;

columnLayout -adj true ;




/////°ïÖú´°¿Ú
string $menuBarLayout = `menuBarLayout`;
menu -label "Help";
menuItem -label "English / ÖÐÎÄ" -c "RenderStats_CH";
menuItem -label "About..." -c "HelpWindow";


separator;




//UI
string $tabs = `tabLayout -w 200 -h 235`;

string $MyTab1 = `scrollLayout -horizontalScrollBarThickness 0`;


///MAYAÉèÖÃ


/////äÖȾÏÔʾPrimary Visibility

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;

text -bgc 1 0.4 0.4 PrimaryVisibility;
button -l "On" -h 24 -c "PrimaryVisibility1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "PrimaryVisibility0";
setParent ..;

/////ͶÉäÒõÓ°Casts Shadows

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;

text -bgc 1 0.4 0.4 CastsShadows;
button -l "On" -h 24 -c "CastsShadows1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "CastsShadows0";
setParent ..;

/////½ÓÊÕÒõÓ°ReceiveShadows

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;
text -bgc 1 0.4 0.4 ReceiveShadows;
button -l "On" -h 24 -c "ReceiveShadows1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "ReceiveShadows0";
setParent ..;

/////·´ÉäÖпɼûVisibleInReflections

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;

text -bgc 1 0.4 0.4 V_InReflections;
button -l "On" -h 24 -c "VisibleInReflections1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "VisibleInReflections0";
setParent ..;

/////ÕÛÉäÖпɼûVisibleInRefractions

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;

text -bgc 1 0.4 0.4 V_InRefractions;
button -l "On" -h 24 -c "VisibleInRefractions1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "VisibleInRefractions0";
setParent ..;

/////Ô˶¯Ä£ºýMotionBlur
rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;

text -bgc 1 0.4 0.4 MotionBlur;
button -l "On" -h 24 -c "MotionBlur1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "MotionBlur0";
setParent ..;

/////»Ö¸´È«²¿ÉèÖÃRestoreSettings
rowColumnLayout -nc 3 -cw 1 90 -cw 2 100 -cw 3 150;

text -bgc 1 0.4 0.4 RestoreSettings;
button -bgc 0 0.7 0.7 -l "Restore settings" -h 24 -c "RestoreSettings";

setParent ..;
setParent ..;

/////MR

///MentalrayÊôÐÔÉèÖÃ


/////FinalGatherCast

string $MyTab2 = `scrollLayout -horizontalScrollBarThickness 0`;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;
text -bgc 1 0.4 0.4 FG_Cast;
button -l "On" -h 24 -c "mFinalGatherCast1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "mFinalGatherCast0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;
text -bgc 1 0.4 0.4 FG_Receive;
button -l "On" -h 24 -c "mFinalGatherReceive1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "mFinalGatherReceive0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;
text -bgc 1 0.4 0.4 VisbleIn_Tr;
button -l "On" -h 24 -c "mTransparencyCast1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "mTransparencyCast0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;
text -bgc 1 0.4 0.4 Transmit_Tr;
button -l "On" -h 24 -c "mTransparencyReceive1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "mTransparencyReceive0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;
text -bgc 1 0.4 0.4 TraceReflection;
button -l "On" -h 24 -c "mReflectionReceive1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "mReflectionReceive0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;
text -bgc 1 0.4 0.4 TransmitRefraction;
button -l "On" -h 24 -c "mRefractionReceive1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "mRefractionReceive0";
setParent ..;


/////»Ö¸´mentalrayÉèÖÃ
rowColumnLayout -nc 3 -cw 1 90 -cw 2 100 -cw 3 150;
text -bgc 1 0.4 0.4 MR_RestoreSet;
button -bgc 0 0.7 0.7 -l "Restore settings" -h 24 -c "mRestoreSettings";


setParent ..;
setParent ..;
/////ArnoldÊôÐÔÉèÖÃ
string $MyTab3 = `scrollLayout -horizontalScrollBarThickness 0`;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;
text -bgc 1 0.4 0.4 SelfShadows;
button -l "On" -h 24 -c "aiSelfShadows1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "aiSelfShadows0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;
text -bgc 1 0.4 0.4 Opaque;
button -l "On" -h 24 -c "aiOpaque1";//·´½á¹û
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "aiOpaque0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;
text -bgc 1 0.4 0.4 VisibleInDiffuse;
button -l "On" -h 24 -c "aiVisibleInDiffuse1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "aiVisibleInDiffuse0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 50 -cw 3 50;
text -bgc 1 0.4 0.4 VisibleInGlossy;
button -l "On" -h 24 -c "aiVisibleInGlossy1";
button -bgc 0 0.7 0.7 -l "Off" -h 24 -c "aiVisibleInGlossy0";
setParent ..;


rowColumnLayout -nc 3 -cw 1 90 -cw 2 100 -cw 3 150;

text -bgc 1 0.4 0.4 RestoreSettings;
button -bgc 0 0.7 0.7 -l "Restore settings" -h 24 -c "AiRestoreSettings";

setParent ..;

//±êÒ³
tabLayout -edit
-tabLabel $MyTab1 "MAYA_set"
-tabLabel $MyTab2 "MR_set"
-tabLabel $MyTab3 "Ar_set"


$tabs;

showWindow RenderStats;
}

////////////////////////ÖÐÎÄ´°»§//////////////////////////////////////////////////////////////////////////////
//´°¿Ú³ÌÐò


global proc RenderStats_CH(){



if(`window -exists RenderStats`) deleteUI RenderStats;

windowPref -ra;

window -wh 270 235 RenderStats;

columnLayout -adj true ;




/////°ïÖú´°¿Ú
string $menuBarLayout = `menuBarLayout`;
menu -label "Help";
menuItem -label "English / ÖÐÎÄ" -c "RenderStats";
menuItem -label "¹ØÓÚ" -c "HelpWindow_CH";

separator;




//UI
string $tabs = `tabLayout -w 270 -h 235`;

string $MyTab1 = `scrollLayout -horizontalScrollBarThickness 0`;


///MAYAÉèÖÃ


/////äÖȾÏÔʾPrimary Visibility

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;

text -bgc 1 0.4 0.4 PrimaryVisibility;
button -l "äÖȾÏÔʾ" -h 24 -c "PrimaryVisibility1";
button -bgc 0 0.7 0.7 -l "äÖȾ²»ÏÔʾ" -h 24 -c "PrimaryVisibility0";
setParent ..;

/////ͶÉäÒõÓ°Casts Shadows

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;

text -bgc 1 0.4 0.4 CastsShadows;
button -l "ͶÉäÒõÓ°" -h 24 -c "CastsShadows1";
button -bgc 0 0.7 0.7 -l "²»Í¶ÉäÒõÓ°" -h 24 -c "CastsShadows0";
setParent ..;

/////½ÓÊÕÒõÓ°ReceiveShadows

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 ReceiveShadows;
button -l "½ÓÊÕÒõÓ°" -h 24 -c "ReceiveShadows1";
button -bgc 0 0.7 0.7 -l "²»½ÓÊÕÒõÓ°" -h 24 -c "ReceiveShadows0";
setParent ..;

/////·´ÉäÖпɼûVisibleInReflections

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;

text -bgc 1 0.4 0.4 V_InReflections;
button -l "·´ÉäÖпɼû" -h 24 -c "VisibleInReflections1";
button -bgc 0 0.7 0.7 -l "·´ÉäÖв»¿É¼û" -h 24 -c "VisibleInReflections0";
setParent ..;

/////ÕÛÉäÖпɼûVisibleInRefractions

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;

text -bgc 1 0.4 0.4 V_InRefractions;
button -l "ÕÛÉäÖпɼû" -h 24 -c "VisibleInRefractions1";
button -bgc 0 0.7 0.7 -l "ÕÛÉäÖв»¿É¼û" -h 24 -c "VisibleInRefractions0";
setParent ..;

/////Ô˶¯Ä£ºýMotionBlur
rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;

text -bgc 1 0.4 0.4 MotionBlur;
button -l "Ô˶¯Ä£ºý" -h 24 -c "MotionBlur1";
button -bgc 0 0.7 0.7 -l "Ô˶¯²»Ä£ºý" -h 24 -c "MotionBlur0";
setParent ..;

/////»Ö¸´È«²¿ÉèÖÃRestoreSettings
rowColumnLayout -nc 3 -cw 1 90 -cw 2 160 -cw 3 150;

text -bgc 1 0.4 0.4 RestoreSettings;
button -bgc 0 0.7 0.7 -l "»Ö¸´È«²¿ÉèÖÃ" -h 24 -c "RestoreSettings";

setParent ..;
setParent ..;

/////MR

///MentalrayÊôÐÔÉèÖÃ


/////FinalGatherCast

string $MyTab2 = `scrollLayout -horizontalScrollBarThickness 0`;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 FG_Cast;
button -l "²úÉúFGÕÕÃ÷" -h 24 -c "mFinalGatherCast1";
button -bgc 0 0.7 0.7 -l "²»²úÉúFGÕÕÃ÷" -h 24 -c "mFinalGatherCast0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 FG_Receive;
button -l "½ÓÊÕFGÕÕÃ÷" -h 24 -c "mFinalGatherReceive1";
button -bgc 0 0.7 0.7 -l "²»½ÓÊÕFGÕÕÃ÷" -h 24 -c "mFinalGatherReceive0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 VisbleIn_Tr;
button -l "͸Ã÷¿É¼û" -h 24 -c "mTransparencyCast1";
button -bgc 0 0.7 0.7 -l "͸Ã÷²»¿É¼û" -h 24 -c "mTransparencyCast0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 Transmit_Tr;
button -l "ÏÔʾ͸Ã÷" -h 24 -c "mTransparencyReceive1";
button -bgc 0 0.7 0.7 -l "²»ÏÔʾ͸Ã÷" -h 24 -c "mTransparencyReceive0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 TraceReflection;
button -l "ÏÔʾ·´Éä" -h 24 -c "mReflectionReceive1";
button -bgc 0 0.7 0.7 -l "²»ÏÔʾ·´Éä" -h 24 -c "mReflectionReceive0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 TransmitRefraction;
button -l "ÏÔʾÕÛÉä" -h 24 -c "mRefractionReceive1";
button -bgc 0 0.7 0.7 -l "²»ÏÔʾÕÛÉä" -h 24 -c "mRefractionReceive0";
setParent ..;


/////»Ö¸´mentalrayÉèÖÃ
rowColumnLayout -nc 3 -cw 1 90 -cw 2 160 -cw 3 150;
text -bgc 1 0.4 0.4 MR_RestoreSet;
button -bgc 0 0.7 0.7 -l "»Ö¸´mentalrayÉèÖÃ" -h 24 -c "mRestoreSettings";


setParent ..;
setParent ..;
/////ArnoldÊôÐÔÉèÖÃ
string $MyTab3 = `scrollLayout -horizontalScrollBarThickness 0`;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 SelfShadows;
button -l "¿ªÆô×ÔÒõÓ°" -h 24 -c "aiSelfShadows1";
button -bgc 0 0.7 0.7 -l "¹Ø±Õ×ÔÒõÓ°" -h 24 -c "aiSelfShadows0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 Opaque;
button -l "¼ÆËã͸Ã÷" -h 24 -c "aiOpaque0";//·´½á¹û
button -bgc 0 0.7 0.7 -l "²»¼ÆËã͸Ã÷" -h 24 -c "aiOpaque1";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 VisibleInDiffuse;
button -l "²ÎÓëÂþÉäÕÕÃ÷" -h 24 -c "aiVisibleInDiffuse1";
button -bgc 0 0.7 0.7 -l "²»²ÎÓëÂþÉäÕÕÃ÷" -h 24 -c "aiVisibleInDiffuse0";
setParent ..;

rowColumnLayout -nc 3 -cw 1 90 -cw 2 80 -cw 3 80;
text -bgc 1 0.4 0.4 VisibleInGlossy;
button -l "²ÎÓë·´ÉäÕÕÃ÷" -h 24 -c "aiVisibleInGlossy1";
button -bgc 0 0.7 0.7 -l "²»²Î·´ÉäÕÕÃ÷" -h 24 -c "aiVisibleInGlossy0";
setParent ..;


rowColumnLayout -nc 3 -cw 1 90 -cw 2 160 -cw 3 150;

text -bgc 1 0.4 0.4 RestoreSettings;
button -bgc 0 0.7 0.7 -l "»Ö¸´ArnoldÉèÖÃ" -h 24 -c "AiRestoreSettings";

setParent ..;






//±êÒ³
tabLayout -edit
-tabLabel $MyTab1 "MAYAÊôÐÔÉèÖÃ"
-tabLabel $MyTab2 "MRÊôÐÔÉèÖÃ"
-tabLabel $MyTab3 "ArÊôÐÔÉèÖÃ"


$tabs;

showWindow RenderStats;
}

internalVar -userScriptDir;
RenderStats;

7.There are three tabs in the tool. Go to Ar_set and you will find visible in diffuse tab.

8.Click on "off" to switch off the diffuse visibility.



Default Occlusion

Contact Occlusion

If there is any problem let me know on my mail id

gourish317@gmail.com

-Thank you.!!

Comments