I’ve been looking for a way to override all materials inside a vrscene with a new material but I couldn’t find a solution. Specifically, I just need to render the vray scene with a gray shader(maintaining displacement and bump would be a plus). Has anyone got any tips for writing a snippet like that?
On a side note, I think a global material override function like the one in Vray for Max would be useful in Maya as well. Unfortunately maya render layers/override can be quite slow when dealing with massive environments.
Usually, you can use another BRDF, however, I presume a default one will suffice.
Regarding the global override, yes, it would be useful, however, it depends on the host application and the way V-Ray is integrated. So for now layers are the current solution.
we are still experimenting with vrscene overrides and we encountered a problem:
We are trying to override the whole scene with one of the material already present inside the vrscene but the render returns a black image. If we manually replace the ‘material’ string with a text editor for all the objects there is no problem. I’ve attached a simple vrscene with two materials and two objects and the code I’m using.
Not as simple I’m afraid. however, another way to override the materials via the snippet is by creating the shader in Maya itself, export it via a post-translate python script and use it as an override through the scene overrides. Try the following:
1. Create the desired override shader in Maya (i.e. VRayMtl1)
2. In the Post-Translate Python Script (Common>MEL/Python callbacks) type the following code to export the fresh shader in the rendered .vrscene:
from vray.utils import *
exportMaterial('VRayMtl1')
3. In the snippet override, use the name of the recently exported shader:
I’ve tried this but the object does not render. Has anyone else had problem using this and managed to get it to work? I’m using v5.00.20.
Also is there any more documentation or example snippets of this feature other then the this page?
I presume that depends on the shader type since I tried it with a regular V-Ray mtl, and “@material” works correctly.
To use them, you need to set the VRayScene load mode to “Geometry”. In the scene name, you type the node name (for xGen hairs - *description*), and in the shader slot, the override shader.
Thank you! I had tried every permutation of node names with the shader overrides, but was only able to get * to work. So for example if the description was top_hair we would use *top_hair*