davoodice
Well-Known Member

کد:
window -width 150 -t "Arnold Tuner" rnd; columnLayout -adjustableColumn true;
button -label "first Run" -command "renderset" -bgc 0.8 0.53 0.52;
button -label "Load Arnold" -command "loadArnold" -bgc 0.65 0.8 0.5;
button -label "Create Sun and Sky" -c "createSkyNodes" -bgc 0.52 0.67 0.8;
button -label "select Sky" -c "selectSky" -bgc 0.7 0.6 0.4;
button -label "Remove Sun and Sky" -c "removeSky" -bgc 0.7 0.6 0.4;
button -label "Close" -c "CLOSE" -bgc 0.8 0.53 0.52;
showWindow;
proc loadArnold () {
catch(`loadPlugin "mtoa"`);
setCurrentRenderer arnold;
$currenrrenderer = `currentRenderer`;
}
proc renderset (){
unifiedRenderGlobalsWindow;
}
proc createSkyNodes () {
string $sky;
$sky = `createRenderNodeCB -asUtility "" aiSky ""`;
rename $sky "DVsky";
$trNode = `listRelatives -p DVsky`;
rename $trNode "sky_Light";
$DVSkyLayer = `createDisplayLayer -name "DV_Sky_L" `;
setAttr "DV_Sky_L.displayType" 2;
setAttr DV_Sky_L.color 18;
setAttr ("DVsky.visibleInReflections") 1;
setAttr ("DVsky.visibleInRefractions") 1;
connectAttr ("DVsky.message") defaultArnoldRenderOptions.background;
$ramp = `createRenderNodeCB -as2DTexture "" ramp ""`;
shadingNode -asTexture ramp;
rename $ramp "DVramp";
connectAttr -force ("DVramp.outColor") ("DVsky.color");
setAttr "DVramp.colorEntryList[0].color" -type double3 0.189776 0.174441 0.126772 ;
setAttr "DVramp.colorEntryList[0].position" 0.495;
setAttr "DVramp.colorEntryList[1].color" -type double3 0.745098 0.881224 1 ;
setAttr "DVramp.colorEntryList[1].position" 0.504;
setAttr "DVramp.colorEntryList[2].color" -type double3 0.280995 0.568597 1 ;
setAttr "DVramp.colorEntryList[2].position" 0.844;
string $sun;
$sun = `directionalLight -rotation 45 30 15 `;
select -r $sun;
scale -r 5 5 5 ;
rotate -r -os -60.025907 50.692697 -15.579982 ;
rename $sun "DVSunShape";
$trNode = `listRelatives -p DVSunShape`;
rename $trNode "DVSun";
setAttr "DVSun.aiExposure" 3;
setAttr "DVSun.aiAngle" 1;
setAttr "DVSun.aiSamples" 3;
select -cl;
$cube = `polyCube`;
$sl = `ls -sl`;
rename $sl[0] "DVCube";
setAttr "DVCubeShape.castsShadows" 0;
setAttr "DVCubeShape.receiveShadows" 0;
setAttr "DVCubeShape.motionBlur" 0;
setAttr "DVCubeShape.primaryVisibility" 0;
setAttr "DVCubeShape.smoothShading" 0;
setAttr "DVCubeShape.visibleInReflections" 0;
setAttr "DVCubeShape.visibleInRefractions" 0;
setAttr "DVCube.visibility" 0;
shadingNode -asShader lambert -n "DVCube_mat";
select -r DVCube;
hyperShade -assign DVCube_mat;
connectAttr -force DVsky.outColor DVCube_mat.color;
}
proc selectSky (){
select -r DVsky;
}
proc CLOSE (){
deleteUI rnd;
}
proc removeSky (){
delete sky_Light;
delete DVSun;
delete DV_Sky_L;
delete DVramp;
delete DVCube;
delete DVCube_mat;
}