[Bf-blender-cvs] [c5bee564eee] refactor-mesh-hide-generic: Merge branch 'master' into refactor-mesh-hide-generic
Hans Goudey
noreply at git.blender.org
Sun May 15 21:02:21 CEST 2022
Commit: c5bee564eeeaecab37ba4add9026f2e68a7f0632
Author: Hans Goudey
Date: Sun May 15 21:02:15 2022 +0200
Branches: refactor-mesh-hide-generic
https://developer.blender.org/rBc5bee564eeeaecab37ba4add9026f2e68a7f0632
Merge branch 'master' into refactor-mesh-hide-generic
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/pbvh_intern.h
index b9ca8c7df2c,9506a077dc6..5dc4d6d75d3
--- a/source/blender/blenkernel/intern/pbvh_intern.h
+++ b/source/blender/blenkernel/intern/pbvh_intern.h
@@@ -143,11 -148,10 +148,11 @@@ struct PBVH
/* NOTE: Normals are not `const` because they can be updated for drawing by sculpt code. */
float (*vert_normals)[3];
+ bool *vert_hide;
- MVert *verts;
- const MPoly *mpoly;
- const MLoop *mloop;
- const MLoopTri *looptri;
+ struct MVert *verts;
+ const struct MPoly *mpoly;
+ const struct MLoop *mloop;
+ const struct MLoopTri *looptri;
CustomData *vdata;
CustomData *ldata;
CustomData *pdata;
diff --cc source/blender/editors/mesh/editface.cc
index d7a7e80aa6e,cb5d48d1023..36086148bb4
--- a/source/blender/editors/mesh/editface.cc
+++ b/source/blender/editors/mesh/editface.cc
@@@ -36,16 -36,16 +36,16 @@@
/* own include */
- void paintface_flush_flags(struct bContext *C, Object *ob, short flag, const bool flush_hidden)
-void paintface_flush_flags(bContext *C, Object *ob, short flag)
++void paintface_flush_flags(bContext *C, Object *ob, short flag, const bool flush_hidden)
{
Mesh *me = BKE_mesh_from_object(ob);
MPoly *polys, *mp_orig;
- const int *index_array = NULL;
+ const int *index_array = nullptr;
int totpoly;
- BLI_assert((flag & ~(SELECT | ME_HIDE)) == 0);
+ BLI_assert((flag & SELECT) || flush_hidden);
- if (me == NULL) {
+ if (me == nullptr) {
return;
}
@@@ -561,8 -539,8 +561,8 @@@ void paintvert_select_ungrouped(Object
for (int i = 0; i < me->totvert; i++) {
MVert *mv = &me->mvert[i];
MDeformVert *dv = &me->dvert[i];
- if ((mv->flag & ME_HIDE) == 0) {
+ if (!(vert_hide && vert_hide[i])) {
- if (dv->dw == NULL) {
+ if (dv->dw == nullptr) {
/* if null weight then not grouped */
mv->flag |= SELECT;
}
diff --cc source/blender/editors/mesh/meshtools.cc
index e27c3b56a47,9057db8851c..524f3dfb053
--- a/source/blender/editors/mesh/meshtools.cc
+++ b/source/blender/editors/mesh/meshtools.cc
@@@ -1333,9 -1327,8 +1327,9 @@@ bool ED_mesh_pick_face_vert
*
* \return boolean true == Found
*/
- typedef struct VertPickData {
+ struct VertPickData {
const MVert *mvert;
+ const bool *vert_hide;
const float *mval_f; /* [2] */
ARegion *region;
@@@ -1349,18 -1342,17 +1343,17 @@@ static void ed_mesh_pick_vert__mapFunc(
const float co[3],
const float UNUSED(no[3]))
{
- VertPickData *data = userData;
+ VertPickData *data = static_cast<VertPickData *>(userData);
- if ((data->mvert[index].flag & ME_HIDE) == 0) {
- float sco[2];
-
- if (ED_view3d_project_float_object(data->region, co, sco, V3D_PROJ_TEST_CLIP_DEFAULT) ==
- V3D_PROJ_RET_OK) {
- const float len = len_manhattan_v2v2(data->mval_f, sco);
- if (len < data->len_best) {
- data->len_best = len;
- data->v_idx_best = index;
- }
+ if (data->vert_hide && data->vert_hide[index]) {
+ return;
+ }
+ float sco[2];
-
+ if (ED_view3d_project_float_object(data->region, co, sco, V3D_PROJ_TEST_CLIP_DEFAULT) ==
+ V3D_PROJ_RET_OK) {
+ const float len = len_manhattan_v2v2(data->mval_f, sco);
+ if (len < data->len_best) {
+ data->len_best = len;
+ data->v_idx_best = index;
}
}
}
More information about the Bf-blender-cvs
mailing list