When used inside a node group in multiple scenes, the defocus node does not refresh active camera data. #38340
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#38340
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version: 2.69 official (win 64)
How to reproduce: Render First Scene. The orange cube is in focus, as it is being used as the active camera's focal point. The defocus node is inside a node group used by both scenes. Now, render the second scene. Notice that the orange cube is out of focus even though the active camera is also using it as a focal point.
Expected behavior: Since both scenes are identical except for the cameras, and both cameras use the same focus, the orange cube should be in focus for both scenes. Instead, it seems that the defocus node persists in using the camera distance data from the first scene in which it was originally added.
Defocus_Node_Bug.blend
Changed status to: 'Open'
Added subscriber: @rocketman
Added subscribers: @Jeroen-Bakker, @monique, @LukasTonne
Added subscriber: @brecht
I think this was added intentionally so that you could do compositing of multiple scenes in one compositing node setup, or use a separate scene for compositing and rendering.
The node remembers the scene, and perhaps that value should be exposed to the user. If empty it uses the current scene, if not you can get the current camera from another scene? I'm not sure what the default should be, perhaps it's least confusing if it's empty and uses the current scene.
@brecht, I wondered about that right after I reported this. That "feature" would be useful for just such a thing, but it seems wrong to make it ambiguous to the user.
I agree with your suggestion on how it could be fixed. That way, defocus can be used in one node group across all scenes if I want (I do want).
This scene-dependency of compositor is quite horrible IMO. It's a quick solution for getting scene info into nodes, but design is weak and it breaks really easy with changing contexts.
Similar issue, where compositing without a scene also doesn't work because of this dependency of the Defocus node: #36745
Just for the record, here is a list of nodes which afaict currently store a scene reference in node->id:
@LukasTonne , That's a very good observation.
If you want to rectify this scene dependency of the Defocus Node, there could be an additional Input node called "Active Camera Data" which would feed DoF and Focus depth values into the Defocus Node.
That way, the Defocus Node would not need to reference any external scene data by itself. In a perfect system, only input nodes should do that.
I think the standard solution would be to include camera data in the EXR metadata, and in Blender it would also be in the RenderResult then. I couldn't quickly find a standard for this metadata, but if you Google for "exr camera metadata" you'll find a bunch of information about people doing similar things.
I agree, @brecht , but which scene's camera data would the output node use? You would still have the same issue as with the Defocus node, in that the node is taking invisible inputs (i.e., camera data) that are not exposed to the user.
If I have an EXR with camera data, but I'm compositing it with another scene with camera data, I would need to specify what camera data goes where. Currently, the Defocus node invisibly pulls the camera data from the scene in which it was first added. How can we unblock the user from choosing the relevant camera inputs for the Defocus and other output nodes?
Added subscriber: @Sergey
@brecht, @LukasTonne what would be the plan here?
I would suggest to only use scene (or other ID pointers) in
node->id
when they are real ID block references that can be selected by the user. These would then stay fixed across changing contexts as well, which avoids a lot of ugly code in blenkernel.For cases where the
node->id
is actually context dependent (composite, defocus) it should not be used at all. Rather for these nodes the context (which is given for a compositor execution) then defines the actual scene from which to take camera data and output render data.This should also fix issues where the hard scene pointer gets outdated, see #38473.
It would also allow for flexible behavior as suggested by @brecht above: If no ID is selected by the user, the context can be used instead.
So I think in practice that means:
Making camera data something you can read from EXR and pass along in the node editor would be nice but beyond the scope of a bugfix I think, the changes above should be relatively simple?
That sounds like a fine solution. Thanks, Everyone!
This issue was referenced by blender/blender-addons-contrib@1687023776
This issue was referenced by
1687023776
Changed status from 'Open' to: 'Resolved'
Closed by commit
1687023776
.