Page MenuHome

Selection: Face selection with XRay and Subdiv
AbandonedPublic

Authored by Jeroen Bakker (jbakker) on Jul 10 2019, 11:10 AM.

Details

Summary

When doing face selection in XRay with a subdiv modifier the subdiv
the selection happens on the cage, not on the subdivided model. This
made it not possible to select faces when Subdivision modifiers were not
enabled in edit mode.

Diff Detail

Repository
rB Blender
Branch
T66630 (branched from master)
Build Status
Buildable 4011
Build 4011: arc lint + arc unit

Event Timeline

Let's get some extra eyes on these last minute fixes.

Wouldn't be something like this more reliable

1diff --git a/source/blender/blenkernel/intern/subdiv_mesh.c b/source/blender/blenkernel/intern/subdiv_mesh.c
2index 75e05f8ffab..3325af5b138 100644
3--- a/source/blender/blenkernel/intern/subdiv_mesh.c
4+++ b/source/blender/blenkernel/intern/subdiv_mesh.c
5@@ -1186,6 +1186,7 @@ Mesh *BKE_subdiv_to_mesh(Subdiv *subdiv,
6 if (!subdiv_context.can_evaluate_normals) {
7 result->runtime.cd_dirty_vert |= CD_MASK_NORMAL;
8 }
9+ result->runtime.is_subdiv_mesh = true;
10 /* Free used memoty. */
11 subdiv_mesh_context_free(&subdiv_context);
12 return result;
13diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
14index 8a9a69ac178..cb7daa426a5 100644
15--- a/source/blender/makesdna/DNA_mesh_types.h
16+++ b/source/blender/makesdna/DNA_mesh_types.h
17@@ -87,7 +87,9 @@ typedef struct Mesh_Runtime {
18 struct SubdivCCG *subdiv_ccg;
19 void *_pad1;
20 int subdiv_ccg_tot_level;
21- char _pad2[4];
22+ /* Mesh is a result of subdivision surface, which created real mesh elements for the surface. */
23+ char is_subdiv_mesh;
24+ char _pad2[3];
25
26 int64_t cd_dirty_vert;
27 int64_t cd_dirty_edge;
?

Then entire modifiers_usesSubsurfFacedots will become return mesh->runtime.is_subdiv_mesh.

Proper fix is to return false if cage_index is -1. I will commit it.