diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-10-10 14:32:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-10-10 14:32:30 +0300 |
commit | d2326e888a48adeaa3acc4924005f1446997489d (patch) | |
tree | d52c8e950650e0acaad8273c997f059be388dd17 /source/blender | |
parent | 0592ac09ffc90aba48b01051f064a688dd37788d (diff) |
Vertex Paint: add back missing VertProjHandle free
Also avoid passing large struct as value.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index dc51e6ad824..84256996acd 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -2492,12 +2492,10 @@ static void do_vpaint_brush_calc_average_color_cb_ex( } static void handle_texture_brush( - SculptThreadedTaskData *data, PBVHVertexIter vd, float size_pressure, float alpha_pressure, + SculptThreadedTaskData *data, const int v_index, float size_pressure, float alpha_pressure, float *r_alpha, uint *r_color) { SculptSession *ss = data->ob->sculpt; - CCGDerivedMesh *ccgdm = BKE_pbvh_get_ccgdm(ss->pbvh); - const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i]; float rgba[4]; float rgba_br[3]; @@ -2566,7 +2564,7 @@ static void do_vpaint_brush_draw_task_cb_ex( float tex_alpha = 1.0; if (data->vpd->is_texbrush) { handle_texture_brush( - data, vd, brush_size_pressure, brush_alpha_pressure, + data, v_index, brush_size_pressure, brush_alpha_pressure, &tex_alpha, &color_final); } /* For each poly owning this vert, paint each loop belonging to this vert. */ @@ -3035,6 +3033,10 @@ static void vpaint_stroke_done(const bContext *C, struct PaintStroke *stroke) ViewContext *vc = &vpd->vc; Object *ob = vc->obact; + if (vpd->is_texbrush) { + ED_vpaint_proj_handle_free(vpd->vp_handle); + } + if (vpd->mlooptag) MEM_freeN(vpd->mlooptag); if (vpd->smear.color_prev) |