When rendering with Mental Ray I always use a dedicated RenderCam. To create this camera I usually do the following
- Create the Camera
- Rename the Camera to “RENDER_CAM”
- Add the Lens shader “mia_exposure_photographic”
- Look through the Camera, Position it
- Do Test Renders
What really bothered me about this process, is that these steps are always the same and for Animations, I forgot to set this camera as the RenderCam for Batch Render. I created this short script to do these steps automatically:
import pymel.core as pm
def createRenderCam(name = "RENDER_CAM", exposure = True):
'''
Creates a camera and renames it
str name: name of the camera
bool exposure: connect a mia\_exposure\_photographic node to the camera
'''
if not pm.objExists(name):
cam = pm.camera()\[0\]
pm.rename(cam, name)
\[cam.renderable.set(cam.name().startswith(name)) for cam in pm.ls(cameras=True)\]
cam = pm.PyNode(name)
if exposure:
if not cam.miLensShader.isConnected():
node = pm.createNode("mia\_exposure\_photographic")
node.film_iso.set(800)
node.f_number.set(1.2)
node.gamma.set(1)
pm.connectAttr(node.message, cam.miLensShader, force=True)
cam.getShape().setDisplayResolution(True)
pm.lookThru(name)
pm.select(cam)
#maya
About Neal Burger
Neal Burger is a successful entrepreuner. He is the founder of Acme Inc, a bootstrapped business that builds affordable SaaS tools for local news, indie publishers, and other small businesses.