Blender Git Loki

Git Commits -> Revision 7db42b8

Revision 7db42b8 by Philipp Oeser (master)
November 16, 2020, 11:52 (GMT)
Fix T82460: Color Management Curves do not update when Image/UV Editor
is present

Caused by rB4212b6528afb.

'updateGLSLCurveMapping()' compares cacheIDs and in certain scenarios,
these are the same when they should not.

- whenever we had multiple viewports that are colormanaged with
curvemappings this worked right (cacheIDs were different)
- for example, this also worked right when the ImageEditor displays a
Render Result or a Compositor Viewer
- but it worked wrong when the Image Editor displays any other Image (or
no Image at all)
- it also worked right if there were multiple Image Editors [and one of
them displays a Render Result e.g]

Now why is this so?

For comparison, the curve mapping's pointer/address is used.

- update_glsl_display_processor frees the curve_mapping, see
BKE_curvemapping_free(global_glsl_state.curve_mapping)
- similar, update_glsl_display_processor creates a new curvemapping, see
BKE_curvemapping_copy(view_settings->curve_mapping)
- now for the situation that a viewport with curvemapping and a viewport
without curvemapping is present and you make changes to the curvemapping
the following happens:
-- curve_mapping_settings->cache_id is set once [to the memory address
of curvemapping before change]
-- change happens
-- viewport 1 frees curvemapping
-- viewport 2 duplicates using BKE_curvemapping_copy, but this one gets
the same address like before the change
-- this means we have different data on the same address with the same
cacheID...

Solution: to really make the cache ID unique we can combine the pointer
with its 'changed_timestamp' [which increases on every change].

Reviewers: jbakker

Maniphest Tasks: T82460

Differential Revision: https://developer.blender.org/D9559

Commit Details:

Full Hash: 7db42b8f2a8cdec5067f2fe73082bd5d806a5e42
Parent Commit: ada79b4
Lines Changed: +1, -1

1 Modified Path:

/source/blender/imbuf/intern/colormanagement.c (+1, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021