Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_engine.c
| Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | static void workbench_cache_sculpt_populate(WORKBENCH_PrivateData *wpd, | ||||
| eV3DShadingColorType color_type) | eV3DShadingColorType color_type) | ||||
| { | { | ||||
| const bool use_vcol = ELEM(color_type, V3D_SHADING_VERTEX_COLOR); | const bool use_vcol = ELEM(color_type, V3D_SHADING_VERTEX_COLOR); | ||||
| const bool use_single_drawcall = !ELEM(color_type, V3D_SHADING_MATERIAL_COLOR); | const bool use_single_drawcall = !ELEM(color_type, V3D_SHADING_MATERIAL_COLOR); | ||||
| BLI_assert(wpd->shading.color_type != V3D_SHADING_TEXTURE_COLOR); | BLI_assert(wpd->shading.color_type != V3D_SHADING_TEXTURE_COLOR); | ||||
| if (use_single_drawcall) { | if (use_single_drawcall) { | ||||
| DRWShadingGroup *grp = workbench_material_setup(wpd, ob, 0, color_type, NULL); | DRWShadingGroup *grp = workbench_material_setup(wpd, ob, 0, color_type, NULL); | ||||
| DRW_shgroup_call_sculpt(grp, ob, false, false, use_vcol); | DRW_shgroup_call_sculpt(grp, ob, false, false); | ||||
| } | } | ||||
| else { | else { | ||||
| const int materials_len = DRW_cache_object_material_count_get(ob); | const int materials_len = DRW_cache_object_material_count_get(ob); | ||||
| struct DRWShadingGroup **shgrps = BLI_array_alloca(shgrps, materials_len); | struct DRWShadingGroup **shgrps = BLI_array_alloca(shgrps, materials_len); | ||||
| for (int i = 0; i < materials_len; i++) { | for (int i = 0; i < materials_len; i++) { | ||||
| shgrps[i] = workbench_material_setup(wpd, ob, i + 1, color_type, NULL); | shgrps[i] = workbench_material_setup(wpd, ob, i + 1, color_type, NULL); | ||||
| } | } | ||||
| DRW_shgroup_call_sculpt_with_materials(shgrps, materials_len, ob, false); | DRW_shgroup_call_sculpt_with_materials(shgrps, materials_len, ob); | ||||
| } | } | ||||
| } | } | ||||
| static void workbench_cache_texpaint_populate(WORKBENCH_PrivateData *wpd, Object *ob) | static void workbench_cache_texpaint_populate(WORKBENCH_PrivateData *wpd, Object *ob) | ||||
| { | { | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| const Scene *scene = draw_ctx->scene; | const Scene *scene = draw_ctx->scene; | ||||
| const ImagePaintSettings *imapaint = &scene->toolsettings->imapaint; | const ImagePaintSettings *imapaint = &scene->toolsettings->imapaint; | ||||
| ▲ Show 20 Lines • Show All 481 Lines • Show Last 20 Lines | |||||