diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2020-10-29 16:40:29 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2020-10-29 19:39:21 +0300 |
commit | 8c3d42bd0f0160ba58c6a932c0e4c228ce6b0426 (patch) | |
tree | a9e020a29c532c227e0a7be9d9c33411e4b8a807 /intern/cycles/blender/blender_light.cpp | |
parent | 2e41db5277a5f90250f398ef3ea8777118dc34ee (diff) |
Fix T82129: Cycles "Persistent Images" incorrectly retains scene data
The issue stems from the fact that scene arrays are not cleared when rendering is done. This was not really an issue before the introduction of the ownership system (rB429afe0c626a) as the id_map would recreate scene data arrays based on their new content. However, now that the id_maps do not have access to the scene data anymore the arrays are never created.
Another related issue is that the BlenderSync instance is never freed when the persistent data option is activated.
To fix this, we delete nodes created by the id_maps in their destructors, and delete the BlenderSync instance before creating a new one, so the id_maps destructors are actually called.
Reviewed By: brecht
Maniphest Tasks: T82129
Differential Revision: https://developer.blender.org/D9378
Diffstat (limited to 'intern/cycles/blender/blender_light.cpp')
-rw-r--r-- | intern/cycles/blender/blender_light.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_light.cpp b/intern/cycles/blender/blender_light.cpp index 117e9214e5a..6f95821e31e 100644 --- a/intern/cycles/blender/blender_light.cpp +++ b/intern/cycles/blender/blender_light.cpp @@ -39,9 +39,9 @@ void BlenderSync::sync_light(BL::Object &b_parent, BL::Light b_light(b_ob.data()); /* Update if either object or light data changed. */ - if (!light_map.add_or_update(scene, &light, b_ob, b_parent, key)) { + if (!light_map.add_or_update(&light, b_ob, b_parent, key)) { Shader *shader; - if (!shader_map.add_or_update(scene, &shader, b_light)) { + if (!shader_map.add_or_update(&shader, b_light)) { if (light->is_portal) *use_portal = true; return; @@ -176,7 +176,7 @@ void BlenderSync::sync_background_light(BL::SpaceView3D &b_v3d, bool use_portal) Light *light; ObjectKey key(b_world, 0, b_world, false); - if (light_map.add_or_update(scene, &light, b_world, b_world, key) || world_recalc || + if (light_map.add_or_update(&light, b_world, b_world, key) || world_recalc || b_world.ptr.data != world_map) { light->type = LIGHT_BACKGROUND; if (sampling_method == SAMPLING_MANUAL) { |