Commit: 2bfa061a15762e93f0391e3348f58bcfa512d8fc
Author: Sergey Sharybin
Date:   Tue Oct 3 12:59:06 2017 +0500
Branches: blender2.8
https://developer.blender.org/rB2bfa061a15762e93f0391e3348f58bcfa512d8fc

Merge branch 'master' into blender2.8

Notes:

- Changes in paint_vertex.c were simple to merge, mainly related on passing
  evaluation context.

- Conflicts in EditDM and drawmesh.c are solved using code from blender2.8
  branch. Those areas are deprecated and not to be used in final release.

  However, it's possible that some reference code from master is lost, so
  keep attention when adding alpha support for vertex painting.

===================================================================



===================================================================

diff --cc source/blender/editors/sculpt_paint/paint_vertex.c
index 9775c136586,4dd218114f6..1df6030bb10
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@@ -1035,11 -1128,9 +1133,11 @@@ static int wpaint_mode_toggle_exec(bCon
                if (ob->sculpt) {
                        BKE_sculptsession_free(ob);
                }
 -              vertex_paint_init_session(scene, ob);
 +              vertex_paint_init_session(&eval_ctx, scene, ob);
        }
  
 +      BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
-       
++
        /* Weightpaint works by overriding colors in mesh,
         * so need to make sure we recalc on enter and
         * exit (exit needs doing regardless because we
@@@ -1228,8 -1319,7 +1326,8 @@@ static bool wpaint_stroke_test_start(bC
        int defbase_tot, defbase_tot_sel;
        bool *defbase_sel;
        SculptSession *ss = ob->sculpt;
-       VPaint *vd = CTX_data_tool_settings(C)->wpaint;
+       VPaint *vp = CTX_data_tool_settings(C)->wpaint;
 +      EvaluationContext eval_ctx;
  
        float mat[4][4], imat[4][4];
  
@@@ -1341,12 -1430,16 +1440,16 @@@
        copy_m3_m4(wpd->wpimat, imat);
  
        /* If not previously created, create vertex/weight paint mode session 
data */
 -      vertex_paint_init_session(scene, ob);
 +      vertex_paint_init_session(&eval_ctx, scene, ob);
-       vwpaint_update_cache_invariants(C, vd, ss, op, mouse);
+       vwpaint_update_cache_invariants(C, vp, ss, op, mouse);
        vertex_paint_init_session_data(ts, ob);
  
-       if (ss->mode.wpaint.previous_weight != NULL) {
-               copy_vn_fl(ss->mode.wpaint.previous_weight, me->totvert, -1.0f);
+       if (ob->sculpt->mode.wpaint.dvert_prev != NULL) {
+               MDeformVert *dv = ob->sculpt->mode.wpaint.dvert_prev;
+               for (int i = 0; i < me->totvert; i++, dv++) {
+                       /* Use to show this isn't initialized, never apply to 
the mesh data. */
+                       dv->flag = 1;
+               }
        }
  
        return true;
@@@ -2084,16 -2251,14 +2267,16 @@@ static int vpaint_mode_toggle_exec(bCon
                        }
                        BKE_sculptsession_free(ob);
                }
 -              vertex_paint_init_session(scene, ob);
 +              vertex_paint_init_session(&eval_ctx, scene, ob);
        }
  
 +      BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
 +
        /* update modifier stack for mapping requirements */
 -      DAG_id_tag_update(&me->id, 0);
 +      DEG_id_tag_update(&me->id, 0);
-       
+ 
        WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene);
-       
+ 
        return OPERATOR_FINISHED;
  }
  
diff --cc source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
index 30d62d5a64e,9483a12aa6a..ef86f3c773d
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
@@@ -698,8 -692,9 +697,9 @@@ static int paint_weight_gradient_modal(
                        BKE_defvert_array_copy(me->dvert, 
vert_cache->wpp.wpaint_prev, me->totvert);
                        wpaint_prev_destroy(&vert_cache->wpp);
                }
+               MEM_freeN(vert_cache);
  
 -              DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
 +              DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
                WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
        }
        else if (ret & OPERATOR_FINISHED) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to