Is there a way (during animations) to have a Depth Of Field target calculated dynamically, based on the first occlusion plane that rays shooting from the centre point of the camera encounter?
This as an alternative to the less convincing method of using a preset (and keyframed) focusing distance, or the more labour-intensive method of using a manually positioned (and keyframed) target.
Preferably this method would be based on - or alternated with - the average occlusion of the current frame.
For example: when there is an object in the middle of the camera view, if most of the frame is covered by the wall of the window the camera is looking through, the camera will focus on the wall, not the object.
As an exaggerated example of this second method, not this: