Python scripts for Subdivision and Texture Input Gamma in Vray for Maya

Maya25 字

给所选择的File节点添加Gamma属性:

#applies Texture Input Gamma to selected File nodes
import maya.cmds as cmds
import maya.OpenMaya as om
fileNodes =cmds.ls(type="file", sl=True)
for f in fileNodes:
    cmds.select(f, r=True)
    cmds.vray("addAttributesFromGroup", f, "vray_file_gamma", 1)
    cmds.select(f, d=True)
    om.MGlobal.displayInfo("Applied Texture Input Gamma to selected File nodes")

给所选择的几何体添加vray细化属性:

#applies Subdivision to selected Shape nodes
import maya.cmds as cmds
import maya.OpenMaya as om
transforms = cmds.ls(tr=True, sl=True)
shapes = cmds.listRelatives(transforms, s=True)
cmds.select(shapes)
for s in shapes:
    cmds.select(s, r=True)
    cmds.vray("addAttributesFromGroup", s, "vray_subdivision", 1)
    cmds.vray("addAttributesFromGroup", s, "vray_subquality", 1)
    cmds.getAttr(".vrayOverrideGlobalSubQual")
    cmds.setAttr(".vrayOverrideGlobalSubQual", 0)
    cmds.select(s, d=True)
    om.MGlobal.displayInfo("Applied Subdivision to selected Shape nodes")
admin
博学之,审问之,慎思之,明辨之,笃行之。
OωO
开启隐私评论,您的评论仅作者和评论双方可见