Commit: a6b37d8c88f916b59a4196ac634b33285834fba0 Author: Hans Goudey Date: Sun May 15 15:46:48 2022 +0200 Branches: refactor-mesh-hide-generic https://developer.blender.org/rBa6b37d8c88f916b59a4196ac634b33285834fba0
Merge branch 'master' into refactor-mesh-hide-generic =================================================================== =================================================================== diff --cc source/blender/blenkernel/intern/bvhutils.cc index a639a1acd8f,4d95cdd1e02..15eda7797ce --- a/source/blender/blenkernel/intern/bvhutils.cc +++ b/source/blender/blenkernel/intern/bvhutils.cc @@@ -1217,10 -1212,11 +1217,10 @@@ static BLI_bitmap *looptri_no_hidden_ma int looptri_no_hidden_len = 0; int looptri_iter = 0; - int poly_index = 0; + int i_poly = 0; while (looptri_iter != looptri_len) { - int mp_totlooptri = mpoly[poly_index].totloop - 2; - if (face_hide[poly_index]) { + int mp_totlooptri = mpoly[i_poly].totloop - 2; - const MPoly &mp = mpoly[i_poly]; - if (mp.flag & ME_HIDE) { ++ if (face_hide[i_poly]) { looptri_iter += mp_totlooptri; } else { diff --cc source/blender/editors/mesh/editface.c index 06c6d4ff8b6,bf4ab788439..d7a7e80aa6e --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@@ -130,11 -128,9 +130,9 @@@ void paintface_hide(bContext *C, Objec } } - if (mpoly->flag & ME_HIDE) { + if (face_hide && face_hide[i]) { mpoly->flag &= ~ME_FACE_SEL; } - - mpoly++; } BKE_mesh_flush_hidden_from_polys(me); @@@ -149,15 -145,12 +147,14 @@@ void paintface_reveal(bContext *C, Obje return; } + bool *face_hide = (bool *)CustomData_get_layer_named(&me->pdata, CD_PROP_BOOL, ".face_hide"); + for (int i = 0; i < me->totpoly; i++) { MPoly *mpoly = &me->mpoly[i]; - if (mpoly->flag & ME_HIDE) { + if (face_hide && face_hide[i]) { SET_FLAG_FROM_TEST(mpoly->flag, select, ME_FACE_SEL); - mpoly->flag &= ~ME_HIDE; + face_hide[i] = false; } - mpoly++; } BKE_mesh_flush_hidden_from_polys(me); @@@ -337,13 -318,9 +328,12 @@@ bool paintface_minmax(Object *ob, floa copy_m3_m4(bmat, ob->obmat); + const bool *face_hide = (const bool *)CustomData_get_layer_named( + &me->pdata, CD_PROP_BOOL, ".face_hide"); + - mvert = me->mvert; - mp = me->mpoly; - for (a = me->totpoly; a > 0; a--, mp++) { - if ((face_hide && face_hide[a]) || !(mp->flag & ME_FACE_SEL)) { + for (int i = 0; i < me->totpoly; i++) { + MPoly *mp = &me->mpoly[i]; - if (mp->flag & ME_HIDE || !(mp->flag & ME_FACE_SEL)) { ++ if ((face_hide && face_hide[i]) || !(mp->flag & ME_FACE_SEL)) { continue; } @@@ -372,11 -348,8 +361,11 @@@ bool paintface_mouse_select(struct bCon bool found = false; /* Get the face under the cursor */ - me = BKE_mesh_from_object(ob); + Mesh *me = BKE_mesh_from_object(ob); + const bool *face_hide = (const bool *)CustomData_get_layer_named( + &me->pdata, CD_PROP_BOOL, ".face_hide"); + if (ED_mesh_pick_face(C, ob, mval, ED_MESH_PICK_DEFAULT_FACE_DIST, &index)) { if (index < me->totpoly) { mpoly_sel = me->mpoly + index; @@@ -569,14 -536,10 +555,13 @@@ void paintvert_select_ungrouped(Object paintvert_deselect_all_visible(ob, SEL_DESELECT, false); } - dv = me->dvert; - tot = me->totvert; - + const bool *vert_hide = (const bool *)CustomData_get_layer_named( + &me->vdata, CD_PROP_BOOL, ".vert_hide"); + - for (a = 0, mv = me->mvert; a < tot; a++, mv++, dv++) { - if (!(vert_hide && vert_hide[a])) { + 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 null weight then not grouped */ mv->flag |= SELECT; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs