Deleting an unused light group caused the environment light group to render to another light group #117586
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#117586
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 546.17
Blender Version
Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash:
9be62e85b727
Worked: (newest version of Blender that worked as expected)
Short description of error
When persistent data enabled, deleting an unused light group caused the environment light group to render to another light group
Exact steps for others to reproduce the error
Ok, I've figured out how to reproduce. I needed to have Persistent Data enabled. I've attached a file that demonstrates the problem.
Render the scene once. Observe the different lightgroup render layers. The
Combined_Environment
layer has the default world illumination.Delete the Unused Light Group.
Render the scene again.
Observe that the
Combined_Environment
is now black. Instead that pass is now part ofCombined_Green
.117586 Light Group Delete Problem.blend
Anyway, given I cannot reproduce in a standalone file, I'm happy to analyse and debug the problem myself.
Using the Python console, I've tried to look through all the data structures but cannot see anything that looks strange.
Looking at the C++ code (BKE_view_layer_remove_lightgroup()) it only appears to change the active lightgroup, then remove the selected record from the linked list. Maybe some other part of the code is using a pointer to that linked list record - though doesn't seem logical that it would then render to a different lightgroup.
I'll get the latest version of the code compiling and run it in the debugger tomorrow.
However my gut feel is that the blend file is a bit messed-up or inconsistent - it's gone through many different Blender versions.
Is there anything specific I should look at in Python or C++?
Ok, I've figured out how to reproduce. I needed to have Persistent Data enabled. I've attached a file that demonstrates the problem.
Render the scene once. Observe the different lightgroup render layers. The
Combined_Environment
layer has the default world illumination.Delete the Unused Light Group.
Render the scene again.
Observe that the
Combined_Environment
is now black. Instead that pass is now part ofCombined_Green
.Another workaround would be to turn off/on Persistent Data.
In the code,
Film::update_lightgroups()
assigns a numeric index to each lightgroup. This successfully detects the change, and returns true.The function
Scene::device_update()
applies some tag updates but not to the background.Later
Background::device_update()
checksis_modified()
(usingsocket_modified
) and returns without updating any settings.Specifically this code is not executed - which leaves
dscene->data.background.lightgroup
with the old (wrong) value.I've looked at why the code works successfully when you clear/set the World Light Group. That functionality is part of
BlenderSync::sync_world()
which appears to detect changes to the lightgroup name, and set thesocket_modified
flag. Of course in my scenario the Environment lightgroup name is unchanged, however the assigned index has changed.Hi, thanks for the report. I can confirm.
cc @LukasStockner
@MarkStead-2 Thanks for the extensive writeup!
@LukasStockner hi, can we backport the fix to 3.6/3.3 LTS? Looks straightforward to me
Good point, thanks:
8508d6992b
603b88f188
Thanks for backporting them :D
For future, you can add commits in backporting list then Philipp/Thomas will backport them to 3.3/3.6LTS: