Skip to content

Instantly share code, notes, and snippets.

@SEVEZ
Created August 29, 2015 11:28
Show Gist options
  • Save SEVEZ/7f316e3038bccb50fb55 to your computer and use it in GitHub Desktop.
Save SEVEZ/7f316e3038bccb50fb55 to your computer and use it in GitHub Desktop.
import maya.cmds as cmds
import maya.mel as mel
import maya.OpenMaya as om
#Add Render Element Extra_Tex
mel.eval("vrayAddRenderElement ExtraTexElement")
#Rename Extra_Tex
cmds.rename("vrayRE_Extra_Tex", "vrayRE_Extra_Tex_PP")
#Set Consider for Anti-Aliasing to 0
cmds.getAttr("vrayRE_Extra_Tex_PP.vray_considerforaa_extratex")
cmds.setAttr("vrayRE_Extra_Tex_PP.vray_considerforaa_extratex", 0)
#Set Filtering to 0
cmds.getAttr("vrayRE_Extra_Tex_PP.vray_filtering_extratex")
cmds.setAttr("vrayRE_Extra_Tex_PP.vray_filtering_extratex", 0)
#Set Filename suffix to "PointPosition"
cmds.getAttr("vrayRE_Extra_Tex_PP.vray_name_extratex")
cmds.setAttr("vrayRE_Extra_Tex_PP.vray_name_extratex", "PointPosition", type="string")
#Create a Sampler Info Node
cmds.createNode("samplerInfo", n="samplerInfo_PP")
#Connect Sampler Info to PP
cmds.connectAttr("samplerInfo_PP.pointWorldX", "vrayRE_Extra_Tex_PP.vray_texture_extratexR")
cmds.connectAttr("samplerInfo_PP.pointWorldY", "vrayRE_Extra_Tex_PP.vray_texture_extratexG")
cmds.connectAttr("samplerInfo_PP.pointWorldZ", "vrayRE_Extra_Tex_PP.vray_texture_extratexB")
#Deselect SamplerInfo
cmds.select("samplerInfo_PP", d=True)
#Display Render Element PointPosition created
om.MGlobal.displayInfo("Render Element PointPosition created")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment