How to Add Motion Blur to your 3D Animation in Post Production by Creating 2D Motion Vectors in Maya

posted in: tutorials | 83

Part 2: Installation and Use of the lm_2DMV Mental Ray Shader to Create a Motion Vector Sequence

This segment will cover the installation and use of lm_2DMV, a Mental Ray shader created just for this purpose. lm_2DMV stands for la maison 2D Motion Vectors. For a long time, lm_2DMV has been the standard way to render out a motion vector pass for ReelSmart Motion Blur. It can also work with a ReelSmart product called SmoothKit, which interpolates between frames in case you need to fake slow motion. With the release of Maya 2009, it became unnecessary to use lm_2DMV because Mental Ray can now export a native render pass that produces the same data. For those of you who don’t have 2009 or just want to use the tried-and-true method, read on. If you want the newer render pass method, then you can move on to Part 3 (see link below).

Part 3: Rendering a 2D Motion Vector Sequence Using Maya 2009’s Built-in Render Pass>>

Step 1. Get the Motion Vector Shader File for Your OS

First go to the site of the shader’s original author, la maison lm_2DMV. You need to get a version that is correct for your OS. If you have Windows 32 bit, then your download is in the “download” section. If you have Mac or Windows 64, then you don’t need anything from the “download” section. Look instead under the “other software and other OS” section for your download. Whatever you choose, you will probably end up with the following three files:

  • lm2DMV_v2.dll
  • lm2DMV_v2.so
  • lm2DMV_v2.spdl

If you are on Windows, then all you need is the .DLL.

I believe that Mac/Linux users need to use the .SO file instead of the .dll.

The reason for the .SPDL (Softimage Plug-in Definition Language) file is that this shader was originally made with SoftImage XSI in mind. Throw away this file and keep the .dll or .so, depending on your OS flavor.

Step 2. Get the Maya-Specific Files

Horvatth Szabolcs created the Maya-specific version. You’ll need the files from this page.

  • AElm2DMV_v2Template.MEL
    This script tells Maya how to display the shader’s attributes in the attribute editor.
  • lm2DMV_v2.MI
    This is the node that will actually show up in your hypershade. If this node could talk, it would say, “When you assign me to  geometry, the render color of that geometry will be decided by what the shader file (your .dll or .so from step 1) dictates.” It also provides the shader’s default numerical values.
  • render_lm2DMV_v2.XPM
    You don’t really need this at all, but it will give your shader a nice icon if you choose to install it.

Step 3. Put Your Four Shiny New Files in The Right Places

lm2DMV_v2.MI goes into ‘Maya app folder/mentalray/include/’

PC path: Program files > Autodesk > Maya(2009) > mentalray > include > lm2DMV_v2.MI

Mac path: Applications > Autodesk > Maya(2009) > Maya > (right click > show package contents) > Contents > mentalray > include > lm2DMV_v2.MI

lm2DMV_v2.dll (or .so) goes into ‘Maya app folder > mentalray > lib/’

PC path: Program files > Autodesk > Maya(2009) > mentalray > lib > lm2DMV_v2.dll

Mac path: Applications > Autodesk > Maya(2009) > Maya > (right click > show package contents) > Contents > mentalray > lib > lm2DMV_v2.so

AElm2DMV_v2Template.MEL goes into ‘Maya app folder > scripts > AETemplates

PC path: Program files > Autodesk > Maya(2009) > scripts > AETemplates (Attribute Editor Templates) > AElm2DMV_v2Template.MEL

Mac path: Applications > Autodesk > Maya(2009) > Maya > (right click > show package contents) > Contents > scripts > AETemplates (Attribute Editor Templates) > AElm2DMV_v2Template.MEL

You can also use one of the other Maya scripts directories for this file, such as the one in your documents folder.

render_lm2DMV_v2.XPM goes into ‘Maya app folder > icons

PC path: Program files > Autodesk > Maya(2009) > icons > render_lm2DMV_v2.XPM

Mac path: Applications > Autodesk > Maya(2009) > Maya > (right click > show package contents) > Contents > icons > render_lm2DMV_v2.XPM

Step 4. Modify the maya.rayrc File

Open maya.rayrc with a text editor. The file is located in ‘Maya app folder > mentalray’

PC path: Program files > Autodesk > Maya(2009) > mentalray > maya.rayrc

Mac path: Applications > Autodesk > Maya(2009) > Maya > (right click > show package contents) > Contents > mentalray > maya.rayrc

If your file doesn’t have any other custom additions, then the file should just contain text with comment # symbols before each line. You can just leave them alone and paste these two lines at the end of the file:

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

Save the file, and then you’re done with this step.

This file will tell Maya to load the lm_2DMV shader when the program starts. After you do this, you can load or unload the shader from within Maya by going to:

Window > Rendering Editors > Mental Ray > Shader Manager

[ad#ad-468×60-textimage]

Step 5. Using the Shader in Maya

Okay! That was tedious, but now it’s all done. Let’s get down to the business of usage.

Tip: Make sure that raytracing is turned off when you render your lm_2DMV render layer. If your camera is moving in space, then the shader may not register the translation if raytracing is on.

Open Maya and your test scene and make sure that the lm_2DMV shader is showing up in the hypershade -> create mental ray nodes tab.

Step 6. Set Motion Blur Render Settings

The five steps below will show you how to turn on motion blur, but to set it to have no blurring effect. You must follow these steps so that Mental Ray will be forced to calculate the motion vectors internally. If you do not do follow these steps, then the shader output will be solid yellow with no variance.

Motion Blur Settings

  1. Make sure you have your masterLayer selected in Render Layers so that the changes happen globally on all render layers (not as a layer override).
  2. Go into the render settings dialogue and find the Motion Blur attributes.
  3. Change the setting to Motion Blur -> Full.
  4. Change Shutter Open and Shutter Close to 0.5.
  5. Again, these changes needs to happen on every render layer, not just on the vector layer. The reason every layer has to change is this: The shutter settings tell Mental Ray to render the temporal position halfway between one frame and the next (for example, instead of rendering frames 1, 2, and 3, the result you will see is 1.5, 2.5, and 3.5).

Step 7. Create a lm_2DMV Render Layer

Render Layers

Select the foreground geometry that you wish to blur and isolate it to its own render layer (by clicking the yellow button shown at right). Name your layer and then assign the lm_2DMV shader as a material override by doing the following:

right click on the render layer -> Overrides -> Create New Material Override -> lm 2dMV_v 2

Step 8. Set Shader Attributes

Now go into your hypershade, find the lm_2DMV node, and open its attribute editor. You will see two options: Target Plugin and Normalize. You will need to adjust Normalize. Basically, what this node is asking is, “In pixels, what is the most that the object will move between one frame and another?” Then the node takes the internal motion vector data and clamps it down to a range based on this setting. As long as you are rendering as a 16-bit image then you can just set this value to 512 (the highest it supports). You will still get plenty of detail in the image without needing to clamp it down further. Whatever you set this value to, you need to also enter that number into the Max Displace field later on in the RSMB plugin.

The RSMB plugin's Max Displace field needs to match the lm2DMV Shader's Normalize field
The RSMB plugin's Max Displace field needs to match the lm_2DMV Shader's Normalize field

With your vector render layer still active, open the render settings dialogue again. You will need to create some layer overrides here, so do the following:

  1. Make sure your motion vector render layer is still the active layer.
  2. Find the option box for raytracing, right click on it, and pick Create Layer Override.
  3. The text should turn orange, indicating that this setting will be changed on this render layer only (otherwise, it would use whatever setting you chose when you had the masterLayer selected).
  4. Turn off raytracing.
  5. Do the same thing to turn off shadows.
  6. If you want to optimize render time further you can experiment with overrides such as lowering the anti-aliasing samples.

Step 9. Make Background and Foreground Beauty Layers

Make two more render layers that contain everything in your scene. You can do this by duplicating the masterLayer twice.

backgroundOn the background layer, you need to turn off primary visibility of all foreground geometry.

  1. Make sure that the background render layer is the active layer.
  2. Select the foreground geometry (what will be blurred).
  3. Go to Window -> General Editors -> Attribute Spreadsheet-> Render tab.
  4. Pick every field under Primary Visibility.
  5. Type 0 (zero) and press Enter.
  6. This should change every field to “off.”

workerNow activate the other render layer that will be your foreground beauty pass.

On this layer, turn off Primary Visibility on all the background geometry to isolate the foreground instead.

The reason that the primary visibility attribute is better than simply hiding or not adding certain geometry to a layer is that, with this method, all the hidden objects are still casting indirect light from final gather, as well as their shadows and reflections (if you want), onto your visible geometry.

Step 10. Make a Second Matte Layer (If Needed)

In many situations, you will use the built-in alphas from your vector or foreground layers and will not need to do anything extra. What I’ve created in this example shows the yellow railing in front of my foreground character layer. This requires an extra step. I had to generate a second matte layer. Using material overrides, I made the railing geometry white (and anything else that obstructed my motion blurred geometry) and everything else black. Remember to apply the same motion blur render settings to this layer as in step 6 (shutter open/close set to 0.5). This layer should be applied in the compositor last. The foreground character and its alpha and blur need to be precomped, and then this railing luma matte needs to be applied to that in order to cut a hole through the foreground character to let the railing show. If this matte was added at the same time as the other alpha(s), then the motion blur plugin would try to use the railing obstruction in its blur calculations, which we definitely don’t want.

railing matte

Step 11. Render It!

Once you have the foreground, background, matte, and vector sequences rendered out, you are ready to move on to the compositing stage. If you are following along with the tutorial and are curious about ReelSmart vs. built-in Maya motion blur, then you can render out your masterLayer with the motion blur shutter overrides set back to 0 and 1 so that you get the default composite beauty with blur sequence for comparison.

83 Responses

  1. vic
    | Reply

    Thank you for posting this tutorial. I was wondering if you could shed some light on the 3d motion vector Render pass in Maya and if it is possible to use that vector information with Reelsmart motion blur?

    Thanks again for this tutorial.

    • Jake
      | Reply

      Hi Vic, The ReelSmart vector plugins can only work with 2D vector data. My guess is that there may be blur plugins for other compositors that can use the 3D vectors.

  2. vic
    | Reply

    Great, thank you for the quick response Jake.

  3. vic
    | Reply

    Hi Jake,
    Is a seperate matte required and added to the 2D vector image in a precomp for Reelsmart to read the vector information appropriately?

    I have tried to render out lm_2dmv vector with alpha from maya. When I import the vector with alpha into after effects, and composite that vector with alpha over a background, reelsmart blurs both the vector with alpha and the background. For some reason, if I render out with no alpha,with surrounding background brownish green, Reelsmart seems to ignore the surrounding green still area and blurs the moving object. It seems like reelsmart does not like anything still that is black. It seems to completely ignore my alpha. I noticed you just render out seperate mattes instead of embedded alpha. Is rendering vectors with embedded alphas an issue? Why would reelsmart blur a background that a vector with embedded alpha is on? It should just ignore anything that has no alpha. Hope this makes sense. Any feedback would be appreciated. Thanks in advance.

    • Jake
      | Reply

      It sounds to me from what you are describing that RSMB is seeing the color black instead of seeing transparent in the background of the vector precomp. If it sees any color (including black) then it will try to interpret it as an amount and direction to blur (black would tell it to 100 percent blur in -x and -y directions) So what needs to be there in the vector precomp’s background is not black but rather nothing / transparent.
      Is there any chance that you have a black solid underneath the keyed vector layer?
      The AE composition window has a little option box on the top right and there’s an option there “transparency grid.” So if you turn that on and look at your vector precomp then what you should see is photoshop style transparency checkers rather than black (this is just to help you know visually if it’s keyed right, it doesn’t change anything as far as RSMB is concerned).
      Let me know if you haven’t solved this by Monday and I’ll post an image and description of the exact keying method that I used.

  4. vic
    | Reply

    Hi Jake,

    Thanks again for responding so quickly. I will double check if in fact there is transparency surrounding my alpha. I assumed that since my alpha was present, that the black surrounding my alpha was transparent and had no information stored. I never clicked on the transparency switch to make sure though. I will double check it when I get back to work in a few days. Thank you again.

  5. Boston Digital Imaging
    | Reply

    Really great stuff.

    I enjoyed being able to see all of your ideas set into action with the addition of your Quicktime video. Great job and thanks for the useful tips.

    -Timothy

  6. Mikael
    | Reply

    Hi Jake.
    I’ve tried your tutorial för the maya 2009 mv render pass, but my output vector images are all wrong. When I render the open EXR format they turn completely black, and if I try any other format the background is gray and the moving object is the same yellow color regardless of it’s direction or speed. Do you have any idea why this is happening? I can mail you my test scene if you want to have a look.
    Thanks for a great and important tutorial though.

    -Mikael

    • Jake
      | Reply

      Hi Mikael,
      The mental ray EXR render pass generates image channels called X Y Z, so then a normal image viewer will show it as all black since there are no RGB channels to display. You must use a compositor to link the X and Y channels into the blur plugin, or remap them to R G to have a look.

      • Mikael
        | Reply

        Oh, you’re right ofc. 🙂
        I got confused when I didn’t get the expected result. It all works just fine now. Thanx!

  7. Chris
    | Reply

    Man, you are really the best! This was a very helpful, informative and well structured tutorial.

    Thanks alot!
    Cheerz Chris

  8. seagoat
    | Reply

    Thanks so much for the tutorial, very helpful. I’m just now getting into Maya 2009 so I needed that leg-up. I’m trying to use my motion vector passes in Nuke, and as a RSMB/lm_2DMV veteran I hadn’t realized that you have to matte your motion pass. Looking forward to using this stuff now that it’s finally out-of-the-box working!

  9. jamie
    | Reply

    when installing the la maison shader, there doesnt seem to be a dll in the download to put in the mental ray/lib folder, will it work without this?

  10. jamie
    | Reply

    there is an xmp file instead of a dll, is that right?

  11. […] Here is an interesting article from Aloe Design Studios on How to to Add Motion Blur to your 3D Animation in Post Production by Creating 2D Motion Vectors in M… […]

  12. kenny
    | Reply

    hi tnx for the tut.
    However i av a major problem with this technique.(maya 2009 mental ray motion vector)
    Even @ the start of the animation wen the object to be blurd is still. the output vector file has a blur on it by default. (i.e an object moving from frame 1-100) @ frame 1 the blur level definitely isnt as high as it wld be @ frame 20, 30,50,80 etc
    but the motion vector been outputted gives it a blur.
    Does dt mean i av to tweak the blur level manually in aftereffect? ( which is tiring).
    i do recollect using the LMDV shader wit maya 8.5.
    to avoid dis problem, in the render settings tab u av to turn filter to 0. that way it wldnt blur a still frame.
    whereas maya 2009 motion vector blur still frames

    • Jake
      | Reply

      Hi Kenny, Normally there is zero blur on zero movement. No additional tweaking should be necessary. I can’t tell what’s going wrong by the amount of information you gave but it’s probably a problem with your settings.

  13. MikeSouth
    | Reply

    Hi,

    When I render out Normalised 2D motion vector pass, the resulting EXRs show no motion (the entire frame is a dark yellow colour).

    I’ve been through the process at least two dozen times and can find no point at which I deviate from the tutorial; though I must be missing something glaring.

    I’ve animated an object, I’m exported EXRs that feature the motino vector pass, and yet nothing but nothing arrives in my compositor.

    Most frustrating.

    • Jake
      | Reply

      Mike, If you’d like to email your file to info at aloedesign.com or post to ftp for me then I’ll have a quick look at it and try to diagnose the issue.

    • Monika
      | Reply

      Hi Mike,

      had the same problem. By now I guess yours is fixed, but I nevertheless wanted to write it down here: The shutterangle of your camera possibly was set to zero, which results in no motion blur. Just select your cameraShape ->Special Effects and set the shutterangle to 144 (whatever you need).

  14. Anakin
    | Reply

    The link to Horvatth Szabolcs files are broken. Do you have files?

  15. claus
    | Reply

    thanks for the tutorial!

    Btw, I think there is a better solution to the temporal syncronisation issue addressed in Step 6.

    In the Render settings, create Layer Overrides for Start and End Frames (for the Motionvector passes only):

    — Frame Range —
    Start Frame -0.5
    End Frame 99.5
    (in case you want to render frames 0-100)

    [x] Renumber frames using
    Start number: 0
    By frame: 1

    By offsetting the motionVector pass 0.5 frames back, it will actually render all frames at whole numbers (1, 2,…). Tis way you don’t need to render half frames at all.

    When rendering using a batch file, you can set it this way:
    render.exe -s -0.5 -e 99.5 -b 1 -rfs 0 -rfb 1 filename.mb

    • Adam
      | Reply

      Maya 2009 has a Motion Offsets section.
      Check the Custom Motion Offset and leave the Motion Back Offset at it’s default 0.5.

      This will offset the Motion Blur render back to the same temporal synchronization as the other non-motion blurred render layers.

  16. Anakin
    | Reply

    @ Claus.

    Your way is still not working in the post – not lined up. I think it has something to do with the start and end of camera shutter. Have you tried it?

    Try with camera zooming back and you will see what I mean. I’m still looking for a solution without having to render all with motion blur enabled – to avoid time penalty.

    Thanks
    Anakin

  17. […] Motion BlurAdd motion blur to your 3-D animation in post-production by creating 2-D motion vectors in Maya. […]

  18. […] Motion BlurAdd motion blur to your 3D animation in post-production by creating 2-D motion vectors in Maya. […]

  19. […] Motion BlurAdd motion blur to your 3D animation in post-production by creating 2-D motion vectors in Maya. […]

  20. […] Motion BlurAdd motion blur to your 3D animation in post-production by creating 2-D motion vectors in Maya. […]

  21. […] Motion BlurAdd motion blur to your 3D animation in post-production by creating 2-D motion vectors in Maya. […]

  22. The Ultimate Collection Of Maya 3D Tutorials | WEBDESIGN FAN
    | Reply

    […] Motion BlurAdd motion blur to your 3D animation in post-production by creating 2-D motion vectors in Maya. […]

  23. The Ultimate Collection Of Maya 3D Tutorials | Search Engine Optimisation
    | Reply

    […] Motion BlurAdd motion blur to your 3D animation in post-production by creating 2-D motion vectors in Maya. […]

  24. […] Motion Blur Add motion blur to your 3D animation in post-production by creating 2-D motion vectors in Maya. […]

  25. Shiv Dholakia
    | Reply

    Jake,

    Thanks for this tutorial, unfortunately I can’t get the motion passes out of Maya 2009’s Normalized 2D MV Remap to work in Fusion. I cycled through all image formats and I can see the color info(red and green etc) but the background is always a milky white/gray color and when I plug these in RSMB, they don’t work. They always have diagonal blur. The lm_2DMV shader works best but I want Maya 2009’s native pass to work correctly.

    Your help on this mater would be much appreciated!

    Thanks!

    Cheers!

    • Jake
      | Reply

      As the tutorial states, RSMB requires an alpha channel with both lm_2DMV and 2Dmv remapped methods. The two methods generate identical results. RSMB should not be seeing any background with either one if you follow the method outlined here for compositing. Read the tutorial completely and hopefully it will make sense.

      • Shiv Dholakia
        | Reply

        Hi Jake,

        Thanks for your response. I matted out an alpha in comp to give my geometry an alpha channel with the 2D Normalized MV Pass but it still doesn’t work. I think the colors are all incorrect especially when I compare it to the pass that lm_2dMV shader outputs.

        I really need to fix this somehow so would you mind if I send you my scene file to look at? Btw, I’m compositing it in Eyeon Fusion using Re:Vision RSMB Motion Vector Blur.

        Thanks, your help would be much appreciated! 🙂

        Cheers,
        SD

        • Jake
          | Reply

          Shiv, I can check that your vector image sequence is correct but I don’t use Fusion so you’re on your own there. You can send me a few of your image + vector sequence in email if you wish.

  26. David
    | Reply

    Hi I recently found your tutorial and have tried it out, but I am not getting the correct results.

    Firstly Maya 2009 doesn’t export 16 or 32 bit with iff or tiff

    I tired exr and it exported 32 bit, but I am not using Aftereffects instead I am using the windows version of Shake v.2.5.1 and the plugin from ReVision.

    Would you know the correct workflow for getting 32 bit tiff’s out of Maya 2009 framebuffers?

    Also what is the correct way in order to use this technique in Shake as there is no documentation anywhere including the plugin documents, as well as the website.

    • Jake
      | Reply

      Hi David,
      As far as I can tell, high-color render passes from Maya are half-baked and will currently only function correctly if rendered as .EXR files.
      You should be able to get this done with shake as long as you render .EXR.
      There is now a tutorial about how to do fake motion blur with Toxik on Autodesk’s the Area website- you might want to look at that for some clues since it’s sort of similar to Shake (though they don’t use RSMB).

  27. David
    | Reply

    Thanks Jake,

    For the reply and advice really appreciate it.

    I was wondering if you help clear up another matter I am having. Following your tutorial for the steps on using the Maya 2009 render passes, I am unclear on how to setup the vector pass using render layers for temporal parity? As this step isn’t quite clear.

  28. Michael
    | Reply

    Hi,

    I have followed the tutorial, but am having troubles compositing in Maya.

    The difference is, i rendered these out as .iff files because thats the format my team are using for this animation.

    The .iff files appear ‘look’ fine in Maya. I made sure they were 16-bit. But when i use a key to take out the background ‘grey’ parts of the vectors, then apply the RSMB plugin to the original beauty layers, it just blurs the beauty layer to ridiculous amounts, doesn’t seem to take any notice of the vectors! Is there a way to fix this?

    cheers

    Michael

    • Jake
      | Reply

      I believe that EXR is the only one that will work right. If you don’t have your alpha attached properly it can also cause this excessive blurring look.

  29. ryan
    | Reply

    Nice Tut. Is there any way to get Maya to embed an alpha in the 2dvector pass? I tried a Targa sequence but it puts out a flat white alpha.

  30. ryan
    | Reply

    never mind I got the EXR to work. Cheers.

  31. James
    | Reply

    Hi Jake,
    Thanks for the great tutorial. I’m still using AE CS3 which doesn’t have EXractoR. Is there a way to pull the channel info out of an EXR using CS3?

    • Jake
      | Reply

      James, you can get EXtractoR from this page: http://fnordware.com/ProEXR/
      The free version comes in the same download as the pro version. I believe it will work fine with CS3.

  32. ryan
    | Reply

    Hmmm I’ve tried this tutorial step by step and everything works out until I apply the EXR 2d normalized vector pass to the RSMB vectors 3.x effect in AE.

    Basically I just animated a 3d sphere flying around, rendered the FG and vector passes and tried to get good vector blur in AE. The blur is wrong and distorted.

    I think it has to do with the EXtractoR. Nothing changes with the vector blur if you assign the extractor X & Y …or R & G which makes me think that RSMB isn’t picking up the vectors from the EXR.

    It would be great if the 2d pass from maya would just output like lm2dv without having to EXR it. Unfortunately other file formats output solid yellow with no alpha.

    I’ve followed all directions properly including temporal alignment, proper pixel disp, applied the EXtractoR to the EXR etc etc. I just can’t get a simple sphere’s blur looking right.
    It’d be great to solve this, as there is no 64 bit version of the lm2dv shader.

    • Jake
      | Reply

      Ryan, the last time I looked there was a 64 bit version. From reading your post my best guess is that you have not put the vector layer + ExtractoR into a precomp in AE. You need to precomp it, then assign the precomp an alpha, then precomp those. If that doesn’t solve it feel free to write back or email me.

  33. ryan
    | Reply

    For another method of rendering out vectors, check out Maya’s “hidden shaders” which work great. Mip_Motion_Vector technique can be found here

    http://www.pixelcg.com/blog/?tag=shader

    And to enable the hidden shaders follow these directions.

    http://forums.cgsociety.org/showthread.php?f=87&t=541718&page=1&pp=15

  34. ryan
    | Reply

    Hi Jake, thx for replying. Your tutorial is great…I think the problem lies within Maya’s normalized vector pass though.
    (It’s not the alpha precompose. I understand that. Plus EXR comes with it’s own embedded alpha).
    What I see here is a huge difference between what the render pass vector renders, and the LM2DV or mip_vector renders. The distribution of color seems to be inaccurate on the mv2DNormRemap render passes version. Playing with the max disp changes the color but it’s still wrong. Check out these images…

    http://www.cronimation.com/vector.jpg
    (it’s even more obvious on a sphere)

    -If you have time, you should render out your tutorial with the mv2DNormRemap and I’ll bet your blur is much different than your LM2DV.

    -p.s. Dou you have the link to the 64 bit shader? It seems this link http://www.alamaison.fr/3d/lm_2DMV/lm_2DMV_ref.htm
    is dead. He’s changed his website.

    Cheers!

    • Jake
      | Reply

      Ryan,

      In my tutorial files the lm2dmv and normalized 2d motion vectors produce identical render results.
      The link to the 64 bit windows version on that page also works for me. If you need a different version you should try contacting them.

      I might have enough time to diagnose your maya test file if you wish to send it.

      • Jake
        | Reply

        Hi Ryan, your setup had a ton of issues. I’ve fixed them and set up a result that is similar between the 2 methods. It is not exact but very close. I will send you your corrected files via email.

        Your Maya setup has some problems:
        1. The luma matte layer you made is not in temporal parity with the MR 2D motion vectors but you’ve used it for its alpha. I recommend turning on the after effects transparency/checkerboard so you can tell what’s going on with the alphas more clearly.
        You need to be careful when trying to make a test like this where every vector method is applied to the same beauty pass because the temporal parities are all inherently different between these:
        a. render layer no motion blur
        b. render layer with MR 2D vector pass applied
        c. lm2dmv with motion blur .5 .5 set
        This is explained in detail in the tutorial.
        To make the temporal match for the lm2dmv layer and the mask render layer with the MR2d motion vec pass, I’ve adjusted the motion blur shutter settings on these layers to .00001, .00001, which is close to what the internal motion vector uses. If you are doing a real-world usage of this you will choose one method or the other for your motion vectors and so this would not matter and you could continue to use .5, .5 for the lm2dmv method.
        2. your displacement value both on the lm2dmv and the mental ray vectors is set to 16 instead of the 512 recommended in the tutorial
        3. I changed the camera environment color to 50% grey on the lm2Dmv layer to give a result that is more similar to the other vector layer
        4. I turned up the antialiasing settings because if you use cheap antialiasing then it may cause artifacts in the blur.

        Your After Effects setup has some problems:
        The Mental ray vector pass is precomped wrong in several ways:
        1. You have generated an EXR sequence that includes both Mental ray vectors and a beauty pass, and you’ve told extractor that the motion vectors are X, Y and BLUE. This is wrong, you don’t want RSMB getting screwed up by seeing the blue beauty channel on top of your motion vectors. Instead, select the Z channel, which is empty. In my tutorial I had selected “copy” for the extractor B channel because I did not have beauty pass information in the EXR so the copy channel was also empty.
        2. You are using the motion vector’s default alpha and then using another luma matte sequence to add another alpha. You need to turn one of them off.

        the lm2dmv vector pass is also precomped wrong:
        1. it’s not precomped
        2. you need to apply extractor to it to correct the gamma and unMult with the .EXR)

        The beauty pass has some problems as well:
        1. it’s not precomped
        2. you need to apply extractor to it to correct the gamma and unMult with the .EXR)
        3. Your RSMB max displace is wrong- you need to set it to 512 just like the motion vectors

        The mask render layer:
        was rendered as an EXR with an alpha so you have a luma matte with an alpha matte on top of it. You need to do the same thing to fix this layer as I did with the others: precomp it, remove the default alpha, apply extractor to it for gamma, then use it on the other layers as a luma matte

        Hope this is helpful. Good luck!

        • ryan
          | Reply

          Fantastic!, thanks for the reply and the time to troubleshoot. I’m more of a CG guy (animation) and I like to learn more about comping. Enjoyed learning this.
          It seems my major issues where inability to duplicate the same vector colors from Maya and I also see how important pre-composing is for this technique. When I raised the max disp to 512 in Maya and applied the Extractor properly in AE, I got similar color to the 512 maxdisp lm2dv pass. I’m used to clamping down the lm2dv pass based on the maxdisplace value output in the MR verbosity messages which is usually around 16-24 for fast moving objects.
          Also my other major problem was that I didn’t pre-compose my 2dmv pass with the matte pass. I thought that AE would just use the embedded alpha in the EXR (or does the EXR even have an embedded alpha?) rsmb needs a matted pre-comp for the vectors.
          Thanks again and whew, pretty technical stuff but I think I got it. Cheers.

  35. ryan
    | Reply

    Really? If you put down a bouncing sphere in Maya and render 2 render layers. One with the normalized vector and the other with the LM2DV applied you get 2 identical renders? Same colors and all? I get a washed out or strange multicolored render (depending on max pixel disp) with the normalized pass that produces incorrect blur in AE. I must be missing a step.
    Yes, the 64 bit link seems to be up now. Good stuff. I’ll send you the sphere file.

  36. […] Motion Blur Add motion blur to your 3D animation in post-production by creating 2-D motion vectors in Maya. […]

  37. JLO
    | Reply

    Hey Jake,

    Great information. When I set everything up in AE and do a quicktime movie I get this big red X covering the whole image. Is there something I can do to fix this? Please Help.

    Thank You

  38. gen
    | Reply

    I read your post and feel it very useful for me.
    Thank you.

    But I have a question. If you dont mind plz answer it.

    If you are rendering out a depth map as well because you intend to add lens blur in post, it’s going to get weird on top of the ReelSmart plugin. You can kind of get around this quirk by 2D motion blurring the foreground geometry depth pass in a precomp so that it matches the main motion blur.

    I can’t understand what this means. You mean I have to
    blur “depth data” using 2d motion vector and reelsmart plugin before adding depth effect to entire images?

    • Jake
      | Reply

      Yes, I was suggesting that you could do the reelsmart filter on the depth pass. It is not a perfect solution. If you really need a quality depth pass with a motion blur then you probably ought to do all your motion blur out of Maya rather than in with reelsmart.

      • gen
        | Reply

        I got it. Thanx!

  39. claus
    | Reply

    this post/turorial helped me a lot using motion vectors! I want to thank you all by contributing another very convenient way to render and use motion vectors in maya, especially in a maya–fusion (or toxik) workflow.

    basically it’s the same as the mental ray motionvector pass thing:

    MAYA:
    – create new render layer, add the geometry to blur. (as you don’t want to render multiple passes, you can assign a standard lambert here and turn on anything fancy like GI/FG…)
    – render settings / common tab: layer override for image format: OpenEXR
    – passes tab: associate the pass called “2D Motion Vector” (mv2DToxik)
    – quality tab:
    layer override for motion blur: “Full”
    shutter open: 0
    shutter close: 0
    set time samples / contrast as you need (eg. 5/0.2)
    framebuffer: layer override “RGBA (Half) 4×16 Bit”
    – Options tab / Performance Secition: Layer override for “Force Motion Vector Computation” –> ON

    FUSION:
    – EXR Sequence -> Channel Booleans (extra channels ON, to X vector: red BG
    to Y vector: green BG
    –> Bol into Vector Motion Blur, set scale accordingly!

    note that there is NO normalize value, so you set the effect just using the scale value of the Vector Motion Blur node. (does anyone know whether this is good or bad?)
    no need for motion offsets here either.

    have fun blurring!
    greetz, claus

  40. Monika
    | Reply

    Hi Jake,

    thanks very much for this tutorial!
    I had some problems creating and applying the motionblur, which I just wanted to share. Hope that is ok with you.

    I have a cameramovement around an object. When I exported the Normalized Motion Vectors I just got a solid dirty yellow tone (R128,G128).
    To get more color variation I adjusted the shutter value of my camera to the default.
    I also adjusted the maxPixelDisplacement to 128 and set my framebuffer to 32bit float, cause the colorinformation with the suggested settings was still not enough (results in very hard edges when extreme motion blur settings are applied).

    In AFX I had the problem, that the blur went diagonal and not in the movement direction. Cause of this was, that I didn’t do the precomp. Even though the alpha was in my image and I used Extractor, AFX didn’t get it. With a precomp of just the motionvector-exr adjusted right it worked.

    Hope I adjusted the settings the right way for my animation. If I did something wrong, please tell me.

    Thanks again,

    Monika

    • Jake
      | Reply

      Hi Monika,
      Yes, you have to set up your precomps just right if you are using after effects.
      Having a moving camera doesn’t work really well with this method of motion blur in my experience, and I think at least with the lm2dmv shader it just doesn’t generate correct blur data. Thanks for your feedback.

  41. […] Motion Blur Add motion blur to your 3D animation in post-production by creating 2-D motion vectors in Maya. […]

  42. Matt
    | Reply

    Hey,
    thx for the comparison . . .

    the maya built-in motionVectorPass produces temporal parity – even with a small displ.Value (0.00001).
    so you are forced to apply the same amount of motionBlur to all your other passes – right!?!

    I tested a large scene with motionBlur on set to 0.00001 . . . and it’s about 10% slower than without .. . . that’s not good (wait)

    hope there are any ways out?!
    best regards matt

  43. braam
    | Reply

    Hi Jake and everyone,

    Any luck with the temporal motion blur problem between Maya and After Effects?

    We really don’t need time penalty for any of other passes! Especially for the Ambient Occlusion and Reflection passes. It is still not lined up 100% in After Effects.

    Regards,
    Braam

    • Adam
      | Reply

      I’ve been setting the Motion Offsets/ Motion Back Offset to 0.0001 and only setting motion blur for the vector pass.

  44. Martin
    | Reply

    I’m having a ton of trouble getting my EXRs into After Effects.

    I’m outputting RGBA(Float) 4×32 Bit EXRs with the framebuffer setting as specified in your other page, but when I get them into after effects the 2D pass is black & EXtractoR says ‘No auxiliary cannels available’. It says the same thing on the (functioning) beauty pass too.

    I have the Preserve RGB checkbox on & everything else I can think of! Amazing Tut BTW.

  45. Nick Guth
    | Reply

    Great information. I wasn’t able to follow the tutorial step by step since a lot of it didn’t pertain to my scene, but I learned from it!

    I have figured out a fairly easy approach to motion vectors out of maya 2010 and into nuke. I am still testing it, but I wanted to know what people think. I’ll try to create a pdf of it as a tutorial/guide if people are interested?

    Basically I’m using the ‘multiply’ knob inside of the vectorBlur node to control the amount of motion blur. Mine happens to use 750 as the value, which looks good. It might be because I am using a 2k render though. Would the resolution affect the multiply value? It seems rather high, but the results look good!

    Cheers.

  46. Vivek
    | Reply

    Hi I followed the tutorial, but the render turns out black. empty? could you please give me some insight

    • Jake
      | Reply

      you are probably not viewing the XYZ motion vector layers of the exr in your compositing software?

  47. Nick Guth
    | Reply

    If you’re having trouble I wrote a document that clearly examples how to use maya and nuke for post motion blur. You can view it on vfxtalk.com or at this link http://www.vfxtalk.com/forum/attachment.php?attachmentid=9558&d=1270799307

    But I agree with Jake, you’re probably not viewing your mv channel. Make sure you’re not viewing RGBA!

  48. […] Motion Blur Add motion blur to your 3D animation in post-production by creating 2-D motion vectors in Maya. […]

  49. Jan
    | Reply

    Hi!
    Great tutorial, but I feel like I’ve missed some bits and pieces since I can’t get my motion vectors to work… could you help me out? Deadlin approaching I’m afraid…

    So I’m using the Normalized MV Pass in Maya 2011 with Max Displacement set to 1024 and file output set to .EXR, 16 bit half in the Quality tab. I get a gray and yellow image that, when applied, just gives me a uniform, diagonal blur.

    Now I’m supposed to move the X and Y channels to the R and G channels but when I apply EXtractoR I don’t see any more channels other than R G and B. No alpha either.

    What could I be doing wrong? Would be super grateful for some help 🙂

    • Jake
      | Reply

      It sounds like you are not compositing the alpha properly (via precomposing if in AE). I went into this a little in the tutorial.

  50. Jan
    | Reply

    Thanks Jake. I got it to work but for some reason, the EXR files that contain Motion Vectors made AE crash. I made a new scene, rendered some EXRs and it worked. I don’t know exactly what I did but finally I managed to import the files, precomp and now I have glorious motion blur 🙂

  51. mike
    | Reply

    hi,
    Thanks a lot for this tutorial, it helped me a lot, but I´m banging my head against the wall because of this: i´d like to add motionblur to my reflection and shadows aswell.. I tried extractor, and also the ProEXR layer plugin to extract the 3d data from my background-layer where a I also aplied the normalized motion vector pass.. (with both different results, but still not working)
    Thanks in advance

    • Jake
      | Reply

      My suggestion for that would be to either render out your motion blur in maya instead or try to use the non-vector-based RSMB plugin on it and let the plugin just try to figure out where the blur should go on its own.

  52. mike
    | Reply

    Allright I give the non-vector-plug-in approach a try (i’d like to maintain some control over the blurriness in post).. I’ll let know if I come up with something genius (haha) which might be usefull to you guys..
    Cheers and keep up the good work!

  53. John
    | Reply

    Great post-blur info here. Any workflow advice on integrating a post DOF (from a plugin like lenscare), with this post motion blur method? It doesn’t seem to me that there is a way to integrate both without a mess.

    I am currently resigned to use thefoundry’s motion blur plugin after I lenscare my compositions. Works pretty well, but breaks down fairly quickly in areas of high movement.

    • Jake
      | Reply

      you could try to apply the post motion blur to the depth pass also.. and then use that as the data for the DOF.. Not sure if it would work in a quality way though.

  54. Gary
    | Reply

    It might be very helpful to post a maya 2010 scene with render passes set up correctly, and also an AfterEffects CS3 file linked to the fooatge, and set up with reelsmart applied correctly…pre-comps and all. Cant get RSMB vectors to work using my own Maya scenes…follwed this and other tutorials to the T. The RSMB Blur is huge and diagonal set to 1024.

  55. […] Motion Blur Add motion blur to your 3D animation in post-production by creating 2-D motion vectors in Maya. […]

  56. Vladimir Pérez
    | Reply

    Great!!!!!! Thank’s Jake a lot… profesional Tips!!!

  57. […] is good information about Motion Blur in web, like: How to Add Motion Blur to your 3D Animation in Post Production by Creating 2D Motion Vectors in Maya <- there is good explanations about this topic. And other good tutorial about this is A Focused […]

Leave a Reply