Vray Render Elements UV and Point Position

Maya29 字
不知道为何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")
admin
博学之,审问之,慎思之,明辨之,笃行之。
OωO
开启隐私评论,您的评论仅作者和评论双方可见