In the render window the changing depth of field works when the camera is animated but it does not render that way. We are stumped.

Basically here is what is going on. I setup an animation with some particles that have an emission property, sparks. I've got a camera with with an fstop set to 0.5 and a 35mm lens. I set the camera to focus on an empty object. Then I animated the empty object moving toward and away from the camera.

Now everything works perfect so far. I can animate a single frame as an image from any point in the animation and everything looks great. I get just the right amount of depth of field and distance camera blur, according to the distance of the empty object from the camera and the frame number I am on. It also pre-renders in the preview window just as expected. Perfect.

However when I go to render the animation the focal distance should follow the empty object, but it remains constant. I have set many key frames for the empty object, moving far and close to the camera. All the frames render out as if the empty object never moves from the first key frame.

I've been doing this in 2.78a, 2.78b & 2.78c. Windows 7 & Windows 10.

As I said, I am doing another test render now to see what the outcome will be. I changed the camera object to display the depth of field in the preview window, and I changed the camera object do use the fstop in the preview mode.

I did recreate this whole scene without the particles using monkey heads and following another different youtube tutorial on FStop & depth of field and created a test render and the animation came out just fine. The focal distance followed the empty object without issue. So now that I know it works, it's just a matter of making it work in the main scene that I'm trying to render.

More updates forth-coming. If it's still an issue I will post the blend file, and maybe we can get to the bottom of this.

  • $\begingroup$ Could you clarify what is not working? The preview has depth of field while the render not? Not at all or has some but less? or..? $\endgroup$ – Carlo Aug 15 '17 at 0:57
  • 3
    $\begingroup$ Please edit your question and add more detail: What render engine are you using? How did you set up the depth of field in your scene (add images that show the camera settings) $\endgroup$ – cegaton Aug 15 '17 at 4:18
  • $\begingroup$ I have done this before. It is not really working too well to even animate the f-stop value in the first place. Cinematographers leave it untouched in shooting scenes as well. I would make the camera focus a certain distance, not an object. Then animate the distance till you are happy. $\endgroup$ – Hendriks3D Aug 15 '17 at 13:54
  • $\begingroup$ @RandyVanNostrand Cycles and Blender internal do depth of field in completely different ways. Again, please specify what render engine you are using. Add images that show the settings for the camera so that we can understand what you are doing. Remember we have no way of knowing anything about your scene but the information you share. $\endgroup$ – cegaton Aug 15 '17 at 14:52

What you can do is use an empty as focus object for the camera and set the F-Stop (to a low value) of the camera.

Camera setting

Then add a constraint to the camera -> Track To -> Empty (To -Z, up Y). This make the camera center to the empty. The empty is now like a cross aim for the camera.

Camera constraint

Then add a constraint to the empty -> Limit Distance -> Camera. Now the focal point is set by the distance of this constraint and you just have to animate the distance to focus and defocus.

Empty constraint

Then you can also move the empty to move the camera a little bit like an you'll do in fly navigation mode.

Fly mode

  • $\begingroup$ Thanks for the input and the support. It looks like the question has been answered by Seth on his own. You folks really stepped up and as always, I appreciate it. What an awesome user community! $\endgroup$ – Randy Van Nostrand Aug 17 '17 at 15:06
  • $\begingroup$ How do I mark this as answered? $\endgroup$ – Randy Van Nostrand Aug 17 '17 at 15:06

Thank you Stephane Monte for your answer but I found the source of my problem.

I actually had already done all of this setup with the empty object and setting it to the focal distance. This was not the source of my problem.

Since sparks move fast I had setup a time adjustment of 30 to 400. So apparently when I key-framed the empty object to move it around the scene and adjust the focal distance, it did so across a time of frames from 14-20,000. I was rendering out from 14-2,000. So the empty was only moving about 2mm between the frames 14-2,000 which of course made it look constant.

The solution for me was to re-scale the key frames down to 14-150, then when running the animation between 14-2,000 at a time adjustment of 30:400 it actually worked out pretty much perfect. I did a test render over the last 2 days and made some final adjustments this morning. Now I'm back into production rendering.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.