BACK TO ARCHIVE
Maya DCC Mechanics & Nuances

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

08.12.2015 ADUCG RESEARCH

给所选择的 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")

本文采用 Creative Commons BY-NC-ND 4.0 协议进行授权。

BY-NC-ND: 署名-非商业性使用-禁止演绎

End of Article