This might be handy for scripting..
It generates all vray elements,
this way you can turn on and off for each layer..
Cheerio
global proc VrayZDEPTH()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Z_depth";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Z_depth;
setAttr -type "string" vrayRE_Z_depth.vrayClassType zdepthChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Z_depth;
setAttr "vrayRE_Z_depth.enabled" 1;
vrayAddAttr("vrayRE_Z_depth","vray_depthBlack");
vrayAddAttr("vrayRE_Z_depth","vray_depthWhite");
vrayAddAttr("vrayRE_Z_depth","vray_depthClamp");
vrayAddAttr("vrayRE_Z_depth","vray_name_zdepth");
vray getAHint "RenderElementAttribute" "vray_depthBlack" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_depthWhite" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_depthClamp" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_zdepth" "vray_parameter";
connectAttr vrayRE_Z_depth.outConnect vraySettings.relements_connect[0];
}
global proc VrayMATERIALID()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Material_ID";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Material_ID;
setAttr -type "string" vrayRE_Material_ID.vrayClassType materialIDChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Material_ID;
setAttr "vrayRE_Material_ID.enabled" 1;
vrayAddAttr("vrayRE_Material_ID","vray_alias_mtlid ");
vrayAddAttr("vrayRE_Material_ID","vray_filename_mt lid");
vrayAddAttr("vrayRE_Material_ID","vray_considerfor aa_mtlid");
vray getAHint "RenderElementAttribute" "vray_alias_mtlid" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_filename_mtlid" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_considerforaa_mtlid" "vray_parameter";
connectAttr vrayRE_Material_ID.outConnect vraySettings.relements_connect[1];
}
global proc VrayMATTESHADOW()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Matte_shadow";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Matte_shadow;
setAttr -type "string" vrayRE_Matte_shadow.vrayClassType matteShadowChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Matte_shadow;
setAttr "vrayRE_Matte_shadow.enabled" 1;
vrayAddAttr("vrayRE_Matte_shadow","vray_alias_matt eshadow");
vrayAddAttr("vrayRE_Matte_shadow","vray_name_matte shadow");
vray getAHint "RenderElementAttribute" "vray_alias_matteshadow" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_matteshadow" "vray_parameter";
connectAttr vrayRE_Matte_shadow.outConnect vraySettings.relements_connect[2];
}
global proc VrayEXTRATEX()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Extra_Tex";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Extra_Tex;
setAttr -type "string" vrayRE_Extra_Tex.vrayClassType ExtraTexElement;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Extra_Tex;
setAttr "vrayRE_Extra_Tex.enabled" 1;
vrayAddAttr("vrayRE_Extra_Tex","vray_name_extratex ");
vrayAddAttr("vrayRE_Extra_Tex","vray_texture_extra tex");
vrayAddAttr("vrayRE_Extra_Tex","vray_considerforaa _extratex");
vrayAddAttr("vrayRE_Extra_Tex","vray_affectmattes_ extratex");
vray getAHint "RenderElementAttribute" "vray_name_extratex" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_texture_extratex" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_considerforaa_extratex" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_affectmattes_extratex" "vray_parameter";
connectAttr vrayRE_Extra_Tex.outConnect vraySettings.relements_connect[3];
}
global proc VrayMATERIALSELECT()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Material_Select";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Material_Select;
setAttr -type "string" vrayRE_Material_Select.vrayClassType MaterialSelectElement;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Material_Select;
setAttr "vrayRE_Material_Select.enabled" 1;
vrayAddAttr("vrayRE_Material_Select","vray_name_mt lselect");
vrayAddAttr("vrayRE_Material_Select","vray_colorMa pping_mtlselect");
vrayAddAttr("vrayRE_Material_Select","vray_mtl_mtl select");
vray getAHint "RenderElementAttribute" "vray_name_mtlselect" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_mtlselect" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_mtl_mtlselect" "vray_parameter";
connectAttr vrayRE_Material_Select.outConnect vraySettings.relements_connect[4];
}
global proc VrayREFRACTION()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Refraction";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Refraction;
setAttr -type "string" vrayRE_Refraction.vrayClassType refractChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Refraction;
setAttr "vrayRE_Refraction.enabled" 1;
vrayAddAttr("vrayRE_Refraction","vray_alias_refrac t");
vrayAddAttr("vrayRE_Refraction","vray_name_refract ");
vrayAddAttr("vrayRE_Refraction","vray_colorMapping _refract");
vray getAHint "RenderElementAttribute" "vray_alias_refract" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_refract" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_refract" "vray_parameter";
connectAttr vrayRE_Refraction.outConnect vraySettings.relements_connect[5];
}
global proc VrayREFLECTION()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Reflection";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Reflection;
setAttr -type "string" vrayRE_Reflection.vrayClassType reflectChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Reflection;
setAttr "vrayRE_Reflection.enabled" 1;
vrayAddAttr("vrayRE_Reflection","vray_alias_reflec t");
vrayAddAttr("vrayRE_Reflection","vray_name_reflect ");
vrayAddAttr("vrayRE_Reflection","vray_colorMapping _reflect");
vray getAHint "RenderElementAttribute" "vray_alias_reflect" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_reflect" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_reflect" "vray_parameter";
connectAttr vrayRE_Reflection.outConnect vraySettings.relements_connect[6];
}
global proc VraySPECULAR()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Specular";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Specular;
setAttr -type "string" vrayRE_Specular.vrayClassType specularChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Specular;
setAttr "vrayRE_Specular.enabled" 1;
vrayAddAttr("vrayRE_Specular","vray_alias_specular ");
vrayAddAttr("vrayRE_Specular","vray_name_specular" );
vrayAddAttr("vrayRE_Specular","vray_colorMapping_s pecular");
vray getAHint "RenderElementAttribute" "vray_alias_specular" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_specular" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_specular" "vray_parameter";
connectAttr vrayRE_Specular.outConnect vraySettings.relements_connect[7];
}
global proc VraySSS()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_SSS";
addAttr -ln "vrayClassType" -dt "string" vrayRE_SSS;
setAttr -type "string" vrayRE_SSS.vrayClassType FastSSS2Channel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_SSS;
setAttr "vrayRE_SSS.enabled" 1;
vrayAddAttr("vrayRE_SSS","vray_alias_sss");
vrayAddAttr("vrayRE_SSS","vray_name_sss");
vrayAddAttr("vrayRE_SSS","vray_colorMapping_sss");
vray getAHint "RenderElementAttribute" "vray_alias_sss" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_sss" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_sss" "vray_parameter";
connectAttr vrayRE_SSS.outConnect vraySettings.relements_connect[8];
}
global proc VrayGI()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_GI";
addAttr -ln "vrayClassType" -dt "string" vrayRE_GI;
setAttr -type "string" vrayRE_GI.vrayClassType giChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_GI;
setAttr "vrayRE_GI.enabled" 1;
vrayAddAttr("vrayRE_GI","vray_alias_gi");
vrayAddAttr("vrayRE_GI","vray_name_gi");
vrayAddAttr("vrayRE_GI","vray_colorMapping_gi");
vray getAHint "RenderElementAttribute" "vray_alias_gi" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_gi" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_gi" "vray_parameter";
connectAttr vrayRE_GI.outConnect vraySettings.relements_connect[9];
}
It generates all vray elements,
this way you can turn on and off for each layer..
Cheerio
global proc VrayZDEPTH()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Z_depth";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Z_depth;
setAttr -type "string" vrayRE_Z_depth.vrayClassType zdepthChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Z_depth;
setAttr "vrayRE_Z_depth.enabled" 1;
vrayAddAttr("vrayRE_Z_depth","vray_depthBlack");
vrayAddAttr("vrayRE_Z_depth","vray_depthWhite");
vrayAddAttr("vrayRE_Z_depth","vray_depthClamp");
vrayAddAttr("vrayRE_Z_depth","vray_name_zdepth");
vray getAHint "RenderElementAttribute" "vray_depthBlack" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_depthWhite" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_depthClamp" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_zdepth" "vray_parameter";
connectAttr vrayRE_Z_depth.outConnect vraySettings.relements_connect[0];
}
global proc VrayMATERIALID()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Material_ID";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Material_ID;
setAttr -type "string" vrayRE_Material_ID.vrayClassType materialIDChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Material_ID;
setAttr "vrayRE_Material_ID.enabled" 1;
vrayAddAttr("vrayRE_Material_ID","vray_alias_mtlid ");
vrayAddAttr("vrayRE_Material_ID","vray_filename_mt lid");
vrayAddAttr("vrayRE_Material_ID","vray_considerfor aa_mtlid");
vray getAHint "RenderElementAttribute" "vray_alias_mtlid" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_filename_mtlid" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_considerforaa_mtlid" "vray_parameter";
connectAttr vrayRE_Material_ID.outConnect vraySettings.relements_connect[1];
}
global proc VrayMATTESHADOW()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Matte_shadow";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Matte_shadow;
setAttr -type "string" vrayRE_Matte_shadow.vrayClassType matteShadowChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Matte_shadow;
setAttr "vrayRE_Matte_shadow.enabled" 1;
vrayAddAttr("vrayRE_Matte_shadow","vray_alias_matt eshadow");
vrayAddAttr("vrayRE_Matte_shadow","vray_name_matte shadow");
vray getAHint "RenderElementAttribute" "vray_alias_matteshadow" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_matteshadow" "vray_parameter";
connectAttr vrayRE_Matte_shadow.outConnect vraySettings.relements_connect[2];
}
global proc VrayEXTRATEX()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Extra_Tex";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Extra_Tex;
setAttr -type "string" vrayRE_Extra_Tex.vrayClassType ExtraTexElement;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Extra_Tex;
setAttr "vrayRE_Extra_Tex.enabled" 1;
vrayAddAttr("vrayRE_Extra_Tex","vray_name_extratex ");
vrayAddAttr("vrayRE_Extra_Tex","vray_texture_extra tex");
vrayAddAttr("vrayRE_Extra_Tex","vray_considerforaa _extratex");
vrayAddAttr("vrayRE_Extra_Tex","vray_affectmattes_ extratex");
vray getAHint "RenderElementAttribute" "vray_name_extratex" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_texture_extratex" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_considerforaa_extratex" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_affectmattes_extratex" "vray_parameter";
connectAttr vrayRE_Extra_Tex.outConnect vraySettings.relements_connect[3];
}
global proc VrayMATERIALSELECT()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Material_Select";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Material_Select;
setAttr -type "string" vrayRE_Material_Select.vrayClassType MaterialSelectElement;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Material_Select;
setAttr "vrayRE_Material_Select.enabled" 1;
vrayAddAttr("vrayRE_Material_Select","vray_name_mt lselect");
vrayAddAttr("vrayRE_Material_Select","vray_colorMa pping_mtlselect");
vrayAddAttr("vrayRE_Material_Select","vray_mtl_mtl select");
vray getAHint "RenderElementAttribute" "vray_name_mtlselect" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_mtlselect" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_mtl_mtlselect" "vray_parameter";
connectAttr vrayRE_Material_Select.outConnect vraySettings.relements_connect[4];
}
global proc VrayREFRACTION()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Refraction";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Refraction;
setAttr -type "string" vrayRE_Refraction.vrayClassType refractChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Refraction;
setAttr "vrayRE_Refraction.enabled" 1;
vrayAddAttr("vrayRE_Refraction","vray_alias_refrac t");
vrayAddAttr("vrayRE_Refraction","vray_name_refract ");
vrayAddAttr("vrayRE_Refraction","vray_colorMapping _refract");
vray getAHint "RenderElementAttribute" "vray_alias_refract" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_refract" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_refract" "vray_parameter";
connectAttr vrayRE_Refraction.outConnect vraySettings.relements_connect[5];
}
global proc VrayREFLECTION()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Reflection";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Reflection;
setAttr -type "string" vrayRE_Reflection.vrayClassType reflectChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Reflection;
setAttr "vrayRE_Reflection.enabled" 1;
vrayAddAttr("vrayRE_Reflection","vray_alias_reflec t");
vrayAddAttr("vrayRE_Reflection","vray_name_reflect ");
vrayAddAttr("vrayRE_Reflection","vray_colorMapping _reflect");
vray getAHint "RenderElementAttribute" "vray_alias_reflect" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_reflect" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_reflect" "vray_parameter";
connectAttr vrayRE_Reflection.outConnect vraySettings.relements_connect[6];
}
global proc VraySPECULAR()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_Specular";
addAttr -ln "vrayClassType" -dt "string" vrayRE_Specular;
setAttr -type "string" vrayRE_Specular.vrayClassType specularChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_Specular;
setAttr "vrayRE_Specular.enabled" 1;
vrayAddAttr("vrayRE_Specular","vray_alias_specular ");
vrayAddAttr("vrayRE_Specular","vray_name_specular" );
vrayAddAttr("vrayRE_Specular","vray_colorMapping_s pecular");
vray getAHint "RenderElementAttribute" "vray_alias_specular" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_specular" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_specular" "vray_parameter";
connectAttr vrayRE_Specular.outConnect vraySettings.relements_connect[7];
}
global proc VraySSS()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_SSS";
addAttr -ln "vrayClassType" -dt "string" vrayRE_SSS;
setAttr -type "string" vrayRE_SSS.vrayClassType FastSSS2Channel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_SSS;
setAttr "vrayRE_SSS.enabled" 1;
vrayAddAttr("vrayRE_SSS","vray_alias_sss");
vrayAddAttr("vrayRE_SSS","vray_name_sss");
vrayAddAttr("vrayRE_SSS","vray_colorMapping_sss");
vray getAHint "RenderElementAttribute" "vray_alias_sss" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_sss" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_sss" "vray_parameter";
connectAttr vrayRE_SSS.outConnect vraySettings.relements_connect[8];
}
global proc VrayGI()
{
shadingNode -asUtility VRayRenderElement;
rename VRayRenderElement1 "vrayRE_GI";
addAttr -ln "vrayClassType" -dt "string" vrayRE_GI;
setAttr -type "string" vrayRE_GI.vrayClassType giChannel;
addAttr -ln "enabled" -at "bool" -dv 1 vrayRE_GI;
setAttr "vrayRE_GI.enabled" 1;
vrayAddAttr("vrayRE_GI","vray_alias_gi");
vrayAddAttr("vrayRE_GI","vray_name_gi");
vrayAddAttr("vrayRE_GI","vray_colorMapping_gi");
vray getAHint "RenderElementAttribute" "vray_alias_gi" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_name_gi" "vray_parameter";
vray getAHint "RenderElementAttribute" "vray_colorMapping_gi" "vray_parameter";
connectAttr vrayRE_GI.outConnect vraySettings.relements_connect[9];
}
Comment