diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-02-23 17:27:29 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-02-24 16:33:48 +0300 |
commit | b7a954218b0d1b90b67f228ae3ab8498710a1a65 (patch) | |
tree | a3e14110eba739637645bee17e1c53c9ca0802f6 /source/blender/editors/space_view3d | |
parent | 17e0634902b7fc8987918e02bc2d4e2090c32e02 (diff) |
Fix T95976: on cage GPU subdivision breaks X-ray selection
When X-ray mode is active the selection is done using the mesh data to
select what is closest to the cursor. When GPU subdivision is active with
the "show on cage" modifier option, this fails as the mesh used for selection
is the unsubdivided one.
This creates a subdivision wrapper before running the selection routines to
ensure that subdivision is available on the CPU side as well.
Differential Revision: https://developer.blender.org/D14188
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_iterators.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_iterators.c b/source/blender/editors/space_view3d/view3d_iterators.c index 990b4fc85b1..d711a3795c8 100644 --- a/source/blender/editors/space_view3d/view3d_iterators.c +++ b/source/blender/editors/space_view3d/view3d_iterators.c @@ -39,6 +39,7 @@ #include "BKE_editmesh.h" #include "BKE_mesh_iterators.h" #include "BKE_mesh_runtime.h" +#include "BKE_mesh_wrapper.h" #include "BKE_modifier.h" #include "DEG_depsgraph.h" @@ -348,6 +349,7 @@ void mesh_foreachScreenVert( Mesh *me = editbmesh_get_eval_cage_from_orig( vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); + me = BKE_mesh_wrapper_ensure_subdivision(vc->obedit, me); ED_view3d_check_mats_rv3d(vc->rv3d); @@ -410,6 +412,7 @@ void mesh_foreachScreenEdge(ViewContext *vc, Mesh *me = editbmesh_get_eval_cage_from_orig( vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); + me = BKE_mesh_wrapper_ensure_subdivision(vc->obedit, me); ED_view3d_check_mats_rv3d(vc->rv3d); @@ -497,6 +500,7 @@ void mesh_foreachScreenEdge_clip_bb_segment(ViewContext *vc, Mesh *me = editbmesh_get_eval_cage_from_orig( vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); + me = BKE_mesh_wrapper_ensure_subdivision(vc->obedit, me); ED_view3d_check_mats_rv3d(vc->rv3d); @@ -568,6 +572,7 @@ void mesh_foreachScreenFace( Mesh *me = editbmesh_get_eval_cage_from_orig( vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); + me = BKE_mesh_wrapper_ensure_subdivision(vc->obedit, me); ED_view3d_check_mats_rv3d(vc->rv3d); data.vc = *vc; |