I was asked at work recently to create some stills for an upcoming event. I wanted to show the transition from a finished rendering to wireframe using a simple blend between the two.
While working on the renders I was trying to find a way to create an object ID pass from the “Render Passes” section in Mental Ray, so that only one render from one render layer would be needed. Unfortunately with time constraints there wasn’t enough time to find a solution, so it was setup in another render layer.
Since I’ve been learning python in my spare time I thought I’d give it a shot and write my own script. The script does two things, first it sets up an object id pass giving all the selected objects in the scene a surface shader with a random color applied to it. Secondly, the ‘Enable Contour/Change Line Thickness’ button allows the user to enable contour rendering on each of the surface shaders’ shading engine check-boxes in the scene; there is a field below the button where the user can add a specific line thickness. From there the user just needs to enable contour rendering from the Mental Ray render globals section. In the end I thought I would make a quick little animation using the technique and playing around with a way to reveal the car traveling from wireframe to it’s beauty pass.
Grab the script here: bwMatteContour