Page MenuHome

Fix T69752: Texture paint sampling colors always 'merged down'
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Sep 12 2019, 2:16 PM.

Details

Summary

Rgression from rBaf4dcc6073fa.

paint_sample_color > imapaint_pick_face uses the the selection buffer
(DRW_select_buffer_sample_point) and to get flat colors [select_id_flat] we
need to be in SCE_SELECT_FACE mode. This was already fine if you had
'Face Selection Masking' turned on, but got colors including lighting
when turned of [select_id_uniform].

There is already an exception in 'select_cache_init' that turns on
SCE_SELECT_FACE for weightpaint, we just need this for texture paint
(vertex paint) as well...

Note we were also asserting here:
BLI_assert failed: /blender/source/blender/draw/engines/select/
select_engine.c:174, select_cache_init(), at 'e_data.context.select_mode
!= 0'

Note also this is not working correctly for vertexpaint (yet), but has
been discussed in T66645 and there is a solution by @Germano Cavalcante (mano-wii) in P1032.

Diff Detail

Repository
rB Blender

Event Timeline

correct comment (wrong task mentioned)

source/blender/draw/engines/select/select_engine.c
169

Is this draw_ctx->object_mode the same as draw_ctx->obact->mode? If so, I think all this logic can be moved to select_id_get_object_select_mode

source/blender/draw/engines/select/select_engine.c
169

I guess it is the same, see https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/draw_manager.c$562
Will move it to select_id_get_object_select_mode then...

moved logic into select_id_get_object_select_mode

This revision is now accepted and ready to land.Sep 12 2019, 5:59 PM