DRW: Fix pointcloud selection

Fixes point cloud selection by using new draw call.

Reviewed By: fclem

Maniphest Tasks: T102659

Differential Revision: https://developer.blender.org/D16501
This commit is contained in:
Jarrett Johnson
2022-11-21 15:49:33 +01:00
committed by Jeroen Bakker
parent 2910be8f19
commit 1c0f5e79fa

View File

@@ -164,6 +164,11 @@ static void basic_cache_populate(void *vedata, Object *ob)
DRW_shgroup_curves_create_sub(ob, stl->g_data->depth_curves_shgrp[do_in_front], NULL); DRW_shgroup_curves_create_sub(ob, stl->g_data->depth_curves_shgrp[do_in_front], NULL);
} }
if (ob->type == OB_POINTCLOUD) {
DRW_shgroup_pointcloud_create_sub(ob, stl->g_data->depth_pointcloud_shgrp[do_in_front], NULL);
return;
}
/* Make flat object selectable in ortho view if wireframe is enabled. */ /* Make flat object selectable in ortho view if wireframe is enabled. */
if ((draw_ctx->v3d->overlay.flag & V3D_OVERLAY_WIREFRAMES) || if ((draw_ctx->v3d->overlay.flag & V3D_OVERLAY_WIREFRAMES) ||
(draw_ctx->v3d->shading.type == OB_WIRE) || (ob->dtx & OB_DRAWWIRE) || (ob->dt == OB_WIRE)) { (draw_ctx->v3d->shading.type == OB_WIRE) || (ob->dtx & OB_DRAWWIRE) || (ob->dt == OB_WIRE)) {
@@ -187,15 +192,8 @@ static void basic_cache_populate(void *vedata, Object *ob)
const bool do_cull = (draw_ctx->v3d && const bool do_cull = (draw_ctx->v3d &&
(draw_ctx->v3d->shading.flag & V3D_SHADING_BACKFACE_CULLING)); (draw_ctx->v3d->shading.flag & V3D_SHADING_BACKFACE_CULLING));
DRWShadingGroup *shgrp = NULL; DRWShadingGroup *shgrp = (do_cull) ? stl->g_data->depth_shgrp_cull[do_in_front] :
stl->g_data->depth_shgrp[do_in_front];
if (ob->type == OB_POINTCLOUD) {
shgrp = stl->g_data->depth_pointcloud_shgrp[do_in_front];
}
else {
shgrp = (do_cull) ? stl->g_data->depth_shgrp_cull[do_in_front] :
stl->g_data->depth_shgrp[do_in_front];
}
if (use_sculpt_pbvh) { if (use_sculpt_pbvh) {
DRW_shgroup_call_sculpt(shgrp, ob, false, false, false, false, false); DRW_shgroup_call_sculpt(shgrp, ob, false, false, false, false, false);