#____________ FALLOF ____________# def shFallof(): # gamma node cmds.shadingNode('gammaCorrect',asUtility=True, n='GammaTemp') cmds.setAttr('GammaTemp.gammaX', 0.455) cmds.setAttr('GammaTemp.gammaY', 0.455) cmds.setAttr('GammaTemp.gammaZ', 0.455) #Creates Ramp cmds.shadingNode('ramp', asTexture=True, n='facingRampTemp') # Remove middle color of ramp cmds.removeMultiInstance( 'facingRampTemp.colorEntryList[1]', b=True ) #Modify Ramp cmds.setAttr('facingRampTemp.colorEntryList[2].color', 0,0,0, type='double3' ) cmds.setAttr('facingRampTemp.colorEntryList[0].color', 1,1,1, type='double3' ) cmds.setAttr('facingRampTemp.colorEntryList[2].position', 1) cmds.setAttr('facingRampTemp.interpolation', 1) #Creates Sampler Info node cmds.shadingNode('samplerInfo', asUtility=True, n='facingSamplerTemp') #Connects Ramp and Sampler cmds.connectAttr('facingSamplerTemp.facingRatio', 'facingRampTemp.vCoord', f=True) cmds.connectAttr('facingRampTemp.outColor', 'GammaTemp.value', f=True) # connect it to a surface shader cmds.shadingNode('surfaceShader', asShader=True, n='SH_TMP_Fallof') cmds.connectAttr('GammaTemp.outValue', 'SH_TMP_Fallof.outColor', f=True) # Select Ramp cmds.select('facingRampTemp', r=True) #Renames nodes so you can use the script as many times as you want cmds.rename('facingRampTemp', 'facingRamp_F') cmds.rename('facingSamplerTemp', 'facingSampler_F') cmds.rename('SH_TMP_Fallof', 'SH_Fallof') cmds.rename('GammaTemp', 'gammaCorrect_F') shFallof() #____________ OCCLU ____________# def shOcclu(): # surface shader cmds.shadingNode('surfaceShader', asShader=True, n='SH_TMP_Occlu') cmds.shadingNode('VRayDirt', asShader=True, n='VrayDirt_TMP') cmds.connectAttr('VrayDirt_TMP.outColor', 'SH_TMP_Occlu.outColor', f=True) #Renames nodes so you can use the script as many times as you want cmds.rename('SH_TMP_Occlu', 'SH_Occlu') cmds.rename('VrayDirt_TMP', 'VrayDirt_O') shOcclu()
9/27/14
MAYA/VRAY/PYTHON _ fallof - occlusion shader
create a fallof and occlusion shader for Vray using python
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment