Hi guys,
We are trying to get paint effects toon lines rendered with V-Ray to be a constant width/thickness in screen space from the camera, but have not found a way to do so.
I resorted to a V-Ray Python Post Translate solution, but somehow it seems to be very unstable where it doesn't update correctly on frame changes... as if it gets processed before the actual changed Paint FX locations/widths are computed for the next frame?
Here's the code snippet we created:
It seems to be somewhat more stable in viewport renders - but even then sometimes switching frame and rendering produced all mangled line setups in the render... then re-rendering the same frame, and voila.... fixed. Very odd.
To be clear... we only found this issue really when the renders came out of Deadline (through mayabatch?) as we hadn't seen it pop up in viewport often (or at least not in a reproducable way). In Deadline only one seemingly random frame seemed to work correctly, which funnily enough was the frame the file was saved on. Any ideas on how to debug?
We are trying to get paint effects toon lines rendered with V-Ray to be a constant width/thickness in screen space from the camera, but have not found a way to do so.
I resorted to a V-Ray Python Post Translate solution, but somehow it seems to be very unstable where it doesn't update correctly on frame changes... as if it gets processed before the actual changed Paint FX locations/widths are computed for the next frame?
Here's the code snippet we created:
Code:
from vray.utils import * multiplier = 0.1 # Get render camera position render_view = findByType("RenderView")[0] transform = render_view.get("transform") campos = transform.offs # Get all GeoMayaHairs and multiply width by distance hairs = findByType("GeomMayaHair") for hair in hairs: widths = hair.get("widths") vertices = hair.get("hair_vertices") for i, (vtx, width) in enumerate(zip(vertices, widths)): dist = (campos - vtx).length() widths[i] = multiplier * width * dist hair.set("widths", widths)
To be clear... we only found this issue really when the renders came out of Deadline (through mayabatch?) as we hadn't seen it pop up in viewport often (or at least not in a reproducable way). In Deadline only one seemingly random frame seemed to work correctly, which funnily enough was the frame the file was saved on. Any ideas on how to debug?
Comment