Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/select/select_engine.c
| Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | static void select_cache_init(void *vedata) | ||||
| SELECTID_StorageList *stl = ((SELECTID_Data *)vedata)->stl; | SELECTID_StorageList *stl = ((SELECTID_Data *)vedata)->stl; | ||||
| 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) { | |||||
| /* Need for sampling weights. */ | |||||
| if (draw_ctx->object_mode & OB_MODE_WEIGHT_PAINT) { | |||||
| e_data.context.select_mode = SCE_SELECT_FACE; | |||||
| } | |||||
| } | |||||
| BLI_assert(e_data.context.select_mode != 0); | BLI_assert(e_data.context.select_mode != 0); | ||||
| } | } | ||||
| { | { | ||||
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. | |||||
| psl->depth_only_pass = DRW_pass_create("Depth Only Pass", DRW_STATE_DEFAULT); | psl->depth_only_pass = DRW_pass_create("Depth Only Pass", DRW_STATE_DEFAULT); | ||||
| stl->g_data->shgrp_depth_only = DRW_shgroup_create(sh_data->select_id_uniform, | stl->g_data->shgrp_depth_only = DRW_shgroup_create(sh_data->select_id_uniform, | ||||
| psl->depth_only_pass); | psl->depth_only_pass); | ||||
| if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) { | if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) { | ||||
| DRW_shgroup_state_enable(stl->g_data->shgrp_depth_only, DRW_STATE_CLIP_PLANES); | DRW_shgroup_state_enable(stl->g_data->shgrp_depth_only, DRW_STATE_CLIP_PLANES); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 249 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