Page History
...
Section | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Available Python Functions and Classes
...
Code Block | ||
---|---|---|
| ||
from vray.utils import * # Assuming an object pPlaneShape1@node has a VRayMtl assigned # Get the material's diffuse texture and pass it through a TexAColorOp # Create a TexAColorOp plugin # Multiply the texture by a color inside TexAColorOp # Get the 'product' output from TexAColorOp and use it as the diffuse input in the VRayMtl node = findByName('pPlaneShape1@node')[0] # Find the node by name node_mtl = node.get('material') # Get the node's material node_brdf = node_mtl.get('brdf') # Get the material's brdf to reach the BRDFVRayMtl plugin diffuseTex = node_brdf.get('diffuse') # Get the diffuse texture of BRDFVRayMtl colorOp = create('TexAColorOp', 'TexAColorOp1') # Create a TexAColorOp texture colorOp.set('color_a', diffuseTex) # Set the VRayMtl's diffuse texture as color_a colorOp.set('color_b', Color(1.0, 0.1, 0.1)) # Set a Color() as color_b node_brdf.set('diffuse', colorOp.output('product')) # Set the 'product' output of TexAColorOp as the diffuse input of BRDFVRayMtl # Similarly, we can get the 'sum' or any other output # node_brdf.set('diffuse', colorOp.output('sum')) |
...