Vray Render Elements UV and Point Position

不知道为何vray for maya中一直没有预置uv和P的输出。而在max中早已经添加了VRaySamplerInfo。


添加uv:

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")

添加P:

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")

 

 

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注