It works great if I do it in compositing on render, just setting a focuspoint for the camera with no native blur and then just using a defocus node. The blur is both in front of and behind the camera focus point.
The problem is that I can’t get this to work when I composite my EXR files later. Everything gets blurred with no focus.
I have tried to use map value to modify the depth map to at least create a focus point myself but I just can’t get it to work.
Well, it looks like I found my own answer after all. Glad I didn’t give up!
What I did was that I simply set a focus distance on the camera in the empty scene I am doing the compositing. It seems the node fetches the camera data right away from the scene. So just put in your values in the active camera of the scene. And if you want it to be like the camera from the other file you rendered from you can just link it and make it active.
(Not to complain on the developers, they are awesome, but it seems kind of weird and against the point of nodes that they pull data from places you can’t control. Wouldn’t it be better with an input with a focus distance and then an input node with that data from your camera of choice? Just in my humble opinion It would be easier to understand why the node behaved like it did if every parameter had an input in the node)