Page MenuHome

Camera DOF distance based on an object doesn't update on animations with compositing Defocus
Closed, ResolvedPublic

Description

System Information
Win 10 64, nvidia 1060 6gb

Blender Version
Broken: blender-2.80.0-git.cad1016c20b5-windows64

Short description of error

Not render engine related. If you use the Defocus node in the compositor, and an animated object as the target for your camera to determine the focus distance, when you press ctrl+f12, the defocus won't animate, stuck at one distance, the one on the frame you had on the viewport before you pressed ctrl+f12. It seems the camera distance based position of the target object is not being evaluated when the animation is being composited. Animating the Distance value of the Camera directly, without an object, works though. And native eevee or cycles depth of field works with animated distance object too. This is not a huge priority or anything.

Exact steps for others to reproduce the error
Play the animation in the viewport and you'll see the distance of the camera focus does change, but render the animation with ctrl+f12 and the defocus doesn't change in the final video. Using eevee's internal depth of field or animating the distance value of the camera directly does work, and you can render that to compare.

Details

Type
Bug

Event Timeline

Philipp Oeser (lichtwerk) claimed this task.
Philipp Oeser (lichtwerk) triaged this task as Confirmed, Medium priority.

Can confirm, checking...

This is basically a known issue at this point. Animation updates for render parameters and compositing are currently restricted to the scene and masks, and including objects will involve some deeper changes.

Hm, yes, compositors ConvertDepthToRadiusOperation::determineFocalDistance calls BKE_camera_object_dof_distance (but with an unevaluated camera, no depsgraph...)
(A renderengine [e.g. Eevee] calls this, too, but has access to the evaluated camera)

While the hacks for compositing [rB9375c941b754, rBdb78a8ee2e8c] worked [and stuff is updated for the copied scene], the compositor goes to the unevaluated camera...
(at least this is how I understand it)

One more argument for a sequencer-depsgraph, I guess...

@Brecht Van Lommel (brecht): what to do then? Put on TODO?

Philipp Oeser (lichtwerk) removed Philipp Oeser (lichtwerk) as the assignee of this task.

Since I wouldnt know how to proceed with this, stepping down...

@Sergey Sharybin (sergey), this bug is still happening after rBb432209f63f8: Render: Use dependency graph for compositor/sequencer.

Seems the empty use to control the distance is not made part of the graph.

find_node component: Could not find ID OBEmpty
add_relation(Camera DOF) - Could not find op_from (ComponentKey(OBEmpty, TRANSFORM))
add_relation(Camera DOF) - Failed, but op_to (ComponentKey(CACamera, PARAMETERS)) was ok

Actually, i think it is now fixed by rBfaf48c0f6473.

The confusing thing is that with the f-stop of 2.4 (used in the attached file) the blur is higher than Max Blur setting. Making f-stop 32 clearly shows that the animation on DoF object works correct.

Brecht Van Lommel (brecht) claimed this task.