Skip to content

Instantly share code, notes, and snippets.

@SEVEZ
Created August 29, 2015 11:26
Show Gist options
  • Save SEVEZ/9f4de64e032b464c645a to your computer and use it in GitHub Desktop.
Save SEVEZ/9f4de64e032b464c645a 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_UV")
#Set Consider for Anti-Aliasing to 0
cmds.getAttr("vrayRE_Extra_Tex_UV.vray_considerforaa_extratex")
cmds.setAttr("vrayRE_Extra_Tex_UV.vray_considerforaa_extratex", 0)
#Set Filtering to 0
cmds.getAttr("vrayRE_Extra_Tex_UV.vray_filtering_extratex")
cmds.setAttr("vrayRE_Extra_Tex_UV.vray_filtering_extratex", 0)
#Set Filename suffix to "UV"
cmds.getAttr("vrayRE_Extra_Tex_UV.vray_name_extratex")
cmds.setAttr("vrayRE_Extra_Tex_UV.vray_name_extratex", "UV", type="string")
#Create a Sampler Info Node
cmds.createNode("samplerInfo", n="samplerInfo_UV")
#Connect Sampler Info to UV
cmds.connectAttr("samplerInfo_UV.uCoord", "vrayRE_Extra_Tex_UV.vray_texture_extratexR")
cmds.connectAttr("samplerInfo_UV.vCoord", "vrayRE_Extra_Tex_UV.vray_texture_extratexG")
#Deselect SamplerInfo
cmds.select("samplerInfo_UV", d=True)
#Display Render Element UV created
om.MGlobal.displayInfo("Render Element UV created")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment