No problem, just a heads-up that it’s a hacky workaround for the moment.
First off, you’ll need to know how V-Ray understands certain things, because some things are represented in one way in Maya, but in another way in V-Ray.
V-Ray represents geometry, material, transformations and the binding of geometry and materials in its own way:
- there geomMesh (among other types) plugins that hold the faces and vertices
- there are node plugins that hold the transformations of geomMeshes, but also bind the geomMesh to a material
- there are material plugins that define certain properties like 2-sided, double-sided, etc, incl. rounded edges
- there are BRDF plugins that define the brdf
In this sense, a cube with a lambert material and rounded edges in Maya will be represented like this in V-Ray:
Node pCubeShape1 {
transform=<transform>; // we won't be dealing with this
material=lambert;
geometry=<geometry>; // we won't be dealing with this
}
MtlSingleBRDF lambert {
brdf=diffuse_brdf;
}
BRDFDiffuse diffuse_brdf {
color=Color(0.5, 0.5, 0.5);
}
When there’s rounded edges applied, the only difference is that there is a MtlRoundedEdges exported, that uses the MtlSingleBRDF as base_mtl. Then the Node’s material equals this MtlRoundedEdges.
We can do a snippet override on our imported vrscene node where we override our node’s material, but then we’ll need to create this material. We can use the above as an override, and we’ll simply need to add the MtlRoundedEdges in between the Node and the MtlSingleBRDF.
Here’s an example of what the snippet would look like, I’ve only included the lines that we’ll need:
BRDFVRayMtl VRayMtl1@vraymtl {
diffuse=AColor(0.5, 0.5, 0.5, 1);
}
MtlSingleBRDF VRayMtl1@material {
brdf=VRayMtl1@vraymtl;
}
MtlRoundEdges roundedEdges {
base_mtl=VRayMtl1@material;
radius=0.5;
raytraced_consider_same_object_only=1;
raytraced_mode=0;
}
Node pCubeShape1@node {
material=roundedEdges;
}
Then there’s yet another way, that might be even simpler, but still hacky. I just gave the above as an example that might help understand the following:
We can add roundedEdges to our scene and use it to replace the vrscene’s objects’ materials at render time with a few simple steps + two lines of scripting.
Now, adding the attributes to another mesh will require this other mesh living somewhere in the scene. But once we know that the rounded edges attribute is actually a material, we can create a MtlRoundedEdges from Create > V-Ray > Create from V-Ray plugin > Material.
Then we can create a new material in Maya, for example a new VRayMtl and plug it into the RoundedEdges Material that we just created.
Then we can use the V-Ray Post-translate Python API to export this new material to V-Ray, then use only that as a snippet override.
This way you can still tweak the settings from what’s in the scene, without adding or changing more code.
1. create a MtlRoundedEdges from Create > V-Ray > Create from V-Ray plugin > Material. Give it any name, in my example I’ve called it roundedEdges_2
2. add a VRayMtl to its base.
3. add this into Render Settings > common tab > mel/python callbacks > post-translate python
from vray.utils import *
exportMaterial('roundedEdges_2')
4. add this as a snippet override:
Node pCubeShape1@node {
material=roundedEdges_2;
}
I’m adding example files.
vrscene_node_rounded_edges.zip (25.7 KB)