The first Python script will apply a Texture Input Gamma from Vray Attributes on selected File nodes.
1 2 3 4 5 6 7 8 9 10 |
#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") |
The second script applies Subdivision from Vray Attributes on selected Shape nodes. The script automatically converts a selected transform node into a shape node, which means that you can select the objects you want to subdivide in the viewport. I also set the script to not Override Global Values in order for you to set the values you want in the Default Displacement and Subdivision tab, instead of typing them in on every object after you flagged the object for Subdivision.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#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") |
Senaste kommentarer