lm2DMV_v2 Mental Ray shader's Maya files



This shader can render visual motion vector information, that can be used by some RevisionFX plugins - namely ReelSmart Motion Blur v3 and ReelSmart Smooth Kit - to render accurate motion blur in post.


- Visit Guy Rabiller's page for this shader at LaMaison.
- Download the Maya files.
(This is a new version of the shader, the old shader's files can still be found here.)



- Copy the MI file to the `maya/mentalray/include` directory.
- Copy the DLL file to the `maya/mentalray/lib` directory.
- Copy the AElm2DMV_v2Template.mel file to a maya script directory.
(The list of the current script directories can be queried using the following mel command: getenv "MAYA_SCRIPT_PATH")

- Add the following lines after similar declarations in the maya.rayrc file:
(The rayrc file is in the Maya/mentalray directory)

link "{MAYABASE}/lib/lm2DMV_v2.{DSO}"

mi "{MAYABASE}/include/lm2DMV_v2.mi"

These lines initialize the shader for Mental Ray. If they do not exist than the shader appears only in Maya but not in Mental Ray,
and it gives error messages in the output window like the following:
API 0.0 error 301031: call to undeclared function "lm2DMV_v2"
API 0.0 error 301036: undefined shader "lm2DMV_v21"

The shader's new version should work with maya binary scenes made with the 1.3 version , since the shader has no new parameters and I kept the old node ID.


The most important settings for the shader to work properly are the following:

- Assign an lm2DMV material to your objects. lm2DMV_v2 appears in the HyperShade at the Create mental ray Nodes / Materials tab.
- Enable Exact (deformation) motion-blur
- Set both Shutter and Shutter Delay attributes to 0.5: this basically enables the computation of motion vectors without actually blurring the rendered image. Both parameters can be found in the Motion Blur/Calculation tab of the Mental Ray Render Globals
- Set the Translation Verbosity to at least Info Messages
- Render a frame that has the most intense movement and check the end of the render output in the Output Window. Look for a line like this: [lm2DMV_v2] >> Max Displace -> 5 pixels. This value is the biggest motion any of the objects currently on the screen did (either transformation, deformation or camera movement), measured in pixels.
- Set this value for the Normalize parameter of the shader to get the most precise information for your final render.
- Render and blur the hell out of your images in your favourite compositing software, that is supported by the RevisionFX plugins.

Have a look at Guy's site for the shader's detailed documentation.