fix own bug in weight gradient tool, need to check if mesh dverts will be overwritten,
authorCampbell Barton <ideasman42@gmail.com>
Thu, 14 Feb 2013 02:21:12 +0000 (02:21 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 14 Feb 2013 02:21:12 +0000 (02:21 +0000)
source/blender/editors/sculpt_paint/paint_vertex.c

index 0c0a5507594ac704f1ce7fa7697e230e6beb77e3..8ff2a68013cb2bb652beb5eb69cb19c895160c13 100644 (file)
@@ -3182,9 +3182,11 @@ static int paint_weight_gradient_modal(bContext *C, wmOperator *op, wmEvent *eve
                VPaint *wp = ts->wpaint;
                Object *ob = CTX_data_active_object(C);
                Mesh *me = ob->data;
-               BKE_defvert_array_free_elems(me->dvert, me->totvert);
-               BKE_defvert_array_copy(me->dvert, wp->wpaint_prev, me->totvert);
-               free_wpaint_prev(wp);
+               if (wp->wpaint_prev) {
+                       BKE_defvert_array_free_elems(me->dvert, me->totvert);
+                       BKE_defvert_array_copy(me->dvert, wp->wpaint_prev, me->totvert);
+                       free_wpaint_prev(wp);
+               }
 
                DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
                WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);