Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/select/select_engine.c
| Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | static void select_cache_init(void *vedata) | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| SELECTID_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | SELECTID_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | ||||
| if (e_data.context.select_mode == -1) { | if (e_data.context.select_mode == -1) { | ||||
| e_data.context.select_mode = select_id_get_object_select_mode(draw_ctx->scene, | e_data.context.select_mode = select_id_get_object_select_mode(draw_ctx->scene, | ||||
| draw_ctx->obact); | draw_ctx->obact); | ||||
| if (e_data.context.select_mode == 0) { | if (e_data.context.select_mode == 0) { | ||||
| /* Need for sampling weights. */ | /* Need for sampling weights / texturepaint / vertexpaint to get flat colors. | ||||
| if (draw_ctx->object_mode & OB_MODE_WEIGHT_PAINT) { | * Note this is not working correctly for vertexpaint (yet), but has been discussed | ||||
| * in T69752 and there is a solution by @mano-wii in P1032. | |||||
| * So OB_MODE_VERTEX_PAINT is already included here [required for P1032 I guess]. */ | |||||
| if (draw_ctx->object_mode & (OB_MODE_WEIGHT_PAINT | OB_MODE_VERTEX_PAINT | OB_MODE_TEXTURE_PAINT)) { | |||||
mano-wii: Is this `draw_ctx->object_mode` the same as `draw_ctx->obact->mode`? If so, I think all this… | |||||
Done Inline ActionsI guess it is the same, see https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/draw_manager.c$562 lichtwerk: I guess it is the same, see https://developer.blender. | |||||
| e_data.context.select_mode = SCE_SELECT_FACE; | e_data.context.select_mode = SCE_SELECT_FACE; | ||||
| } | } | ||||
| } | } | ||||
| BLI_assert(e_data.context.select_mode != 0); | BLI_assert(e_data.context.select_mode != 0); | ||||
| } | } | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 257 Lines • Show Last 20 Lines | |||||
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