Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.cc')
-rw-r--r--source/blender/editors/space_view3d/view3d_select.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.cc b/source/blender/editors/space_view3d/view3d_select.cc
index f757cb45eec..714eff79777 100644
--- a/source/blender/editors/space_view3d/view3d_select.cc
+++ b/source/blender/editors/space_view3d/view3d_select.cc
@@ -334,7 +334,8 @@ static bool edbm_backbuf_check_and_select_verts_obmode(Mesh *me,
EditSelectBuf_Cache *esel,
const eSelectOp sel_op)
{
- MVert *mv = me->mvert;
+ MVert *verts = BKE_mesh_vertices_for_write(me);
+ MVert *mv = verts;
bool changed = false;
const BLI_bitmap *select_bitmap = esel->select_bitmap;
@@ -363,22 +364,22 @@ static bool edbm_backbuf_check_and_select_faces_obmode(Mesh *me,
EditSelectBuf_Cache *esel,
const eSelectOp sel_op)
{
- MPoly *mpoly = me->mpoly;
+ MPoly *polygons = BKE_mesh_polygons_for_write(me);
bool changed = false;
const BLI_bitmap *select_bitmap = esel->select_bitmap;
- if (mpoly) {
+ if (polygons) {
const bool *hide_poly = (const bool *)CustomData_get_layer_named(
- &me->pdata, CD_PROP_BOOL, ".hide_poly");
+ &me->vdata, CD_PROP_BOOL, ".hide_poly");
- for (int index = 0; index < me->totpoly; index++, mpoly++) {
+ for (int index = 0; index < me->totpoly; index++) {
if (!(hide_poly && hide_poly[index])) {
- const bool is_select = mpoly->flag & ME_FACE_SEL;
+ const bool is_select = polygons[index].flag & ME_FACE_SEL;
const bool is_inside = BLI_BITMAP_TEST_BOOL(select_bitmap, index);
const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside);
if (sel_op_result != -1) {
- SET_FLAG_FROM_TEST(mpoly->flag, sel_op_result, ME_FACE_SEL);
+ SET_FLAG_FROM_TEST(polygons[index].flag, sel_op_result, ME_FACE_SEL);
changed = true;
}
}
@@ -2813,13 +2814,15 @@ static bool ed_wpaint_vertex_select_pick(bContext *C,
Mesh *me = static_cast<Mesh *>(obact->data); /* already checked for nullptr */
uint index = 0;
+ MVert *verts = BKE_mesh_vertices_for_write(me);
+
MVert *mv;
bool changed = false;
bool found = ED_mesh_pick_vert(C, obact, mval, ED_MESH_PICK_DEFAULT_VERT_DIST, use_zbuf, &index);
if (params->sel_op == SEL_OP_SET) {
- if ((found && params->select_passthrough) && (me->mvert[index].flag & SELECT)) {
+ if ((found && params->select_passthrough) && (verts[index].flag & SELECT)) {
found = false;
}
else if (found || params->deselect_all) {
@@ -2829,7 +2832,7 @@ static bool ed_wpaint_vertex_select_pick(bContext *C,
}
if (found) {
- mv = &me->mvert[index];
+ mv = &verts[index];
switch (params->sel_op) {
case SEL_OP_ADD: {
mv->flag |= SELECT;