Fix #107768: vertex paint selection with retopology overlay #107833
|
@ -217,7 +217,7 @@ static void select_cache_populate(void *vedata, Object *ob)
|
|||
|
||||
const bool retopology_occlusion = RETOPOLOGY_ENABLED(draw_ctx->v3d) &&
|
||||
!XRAY_ENABLED(draw_ctx->v3d);
|
||||
if (retopology_occlusion && !DRW_object_is_in_edit_mode(ob)) {
|
||||
if (retopology_occlusion && !DRW_object_should_not_occlude(ob)) {
|
||||
if (ob->dt >= OB_SOLID) {
|
||||
struct GPUBatch *geom_faces = DRW_mesh_batch_cache_get_surface(ob->data);
|
||||
DRW_shgroup_call_obmat(stl->g_data->shgrp_occlude, geom_faces, ob->object_to_world);
|
||||
|
|
|
@ -877,6 +877,14 @@ bool DRW_object_is_renderable(const struct Object *ob);
|
|||
* This will not be the case when one of the objects are influenced by modifiers.
|
||||
*/
|
||||
bool DRW_object_is_in_edit_mode(const struct Object *ob);
|
||||
|
||||
/**
|
||||
* Should `ob` be used for occlusion in selection when in weight and vertex paint mode, this
|
||||
* is needed for when retopology overlay is enabled to still be able to render IDs for face
|
||||
* and vertex selection.
|
||||
*/
|
||||
bool DRW_object_should_not_occlude(const Object *ob);
|
||||
|
||||
/**
|
||||
* Return whether this object is visible depending if
|
||||
* we are rendering or drawing in the viewport.
|
||||
|
|
|
@ -210,6 +210,21 @@ bool DRW_object_is_in_edit_mode(const Object *ob)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool DRW_object_should_not_occlude(const Object *ob)
|
||||
{
|
||||
if (DRW_object_is_in_edit_mode(ob)) {
|
||||
return true;
|
||||
}
|
||||
if (ob->type == OB_MESH && (ob->mode & OB_MODE_VERTEX_PAINT) ||
|
||||
(ob->mode & OB_MODE_WEIGHT_PAINT)) {
|
||||
Mesh *me = ob->data;
|
||||
if ((ME_EDIT_PAINT_SEL_MODE(me))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int DRW_object_visibility_in_active_context(const Object *ob)
|
||||
{
|
||||
const eEvaluationMode mode = DRW_state_is_scene_render() ? DAG_EVAL_RENDER : DAG_EVAL_VIEWPORT;
|
||||
|
@ -2788,7 +2803,7 @@ void DRW_draw_select_id(Depsgraph *depsgraph, ARegion *region, View3D *v3d, cons
|
|||
* It also has non-mesh objects however, which are not supported here. */
|
||||
continue;
|
||||
}
|
||||
if (DRW_object_is_in_edit_mode(ob)) {
|
||||
if (DRW_object_should_not_occlude(ob)) {
|
||||
/* Only background (non-edit) objects are used for occlusion. */
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue