Fix T59640: Transform w/ auto-merge & hidden verts crashes
authorCampbell Barton <ideasman42@gmail.com>
Wed, 16 Jan 2019 03:54:52 +0000 (14:54 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 16 Jan 2019 04:05:48 +0000 (15:05 +1100)
source/blender/bmesh/intern/bmesh_operators.c
source/blender/editors/sculpt_paint/sculpt.c

index 546bd9fb461fdf280b68cd062ef79f63c2a7ceb0..61a86070f76cc433e0844f7982a55c79a332837d 100644 (file)
@@ -1847,7 +1847,12 @@ bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt,
                                                        BMO_slot_buffer_from_disabled_hflag(bm, op, op->slots_in, slot_name, htype, va_arg(vlist, int));
                                                }
                                                else if (type == 'a') {
-                                                       BMO_slot_buffer_from_all(bm, op, op->slots_in, slot_name, htype);
+                                                       if ((op->flag & BMO_FLAG_RESPECT_HIDE) == 0) {
+                                                               BMO_slot_buffer_from_all(bm, op, op->slots_in, slot_name, htype);
+                                                       }
+                                                       else {
+                                                               BMO_slot_buffer_from_disabled_hflag(bm, op, op->slots_in, slot_name, htype, BM_ELEM_HIDDEN);
+                                                       }
                                                }
                                                else if (type == 'f') {
                                                        BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_in, slot_name, htype, va_arg(vlist, int));
index 95205ad69f23d199ebfc99c18aacaf5d7b00e2ec..2a49c6dc388727fca89aa4ee4fefbc86c376b127 100644 (file)
@@ -5578,7 +5578,7 @@ static int sculpt_symmetrize_exec(bContext *C, wmOperator *UNUSED(op))
        BM_mesh_toolflags_set(ss->bm, true);
 
        /* Symmetrize and re-triangulate */
-       BMO_op_callf(ss->bm, BMO_FLAG_DEFAULTS,
+       BMO_op_callf(ss->bm, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
                     "symmetrize input=%avef direction=%i  dist=%f",
                     sd->symmetrize_direction, 0.00001f);
        sculpt_dynamic_topology_triangulate(ss->bm);