[Bf-blender-cvs] [3e24dc3] soc-2016-pbvh-painting: Fix build errors under linux, and cleanup a bunch of warnings.

Bastien Montagne noreply at git.blender.org
Fri Aug 12 18:34:02 CEST 2016


Commit: 3e24dc367f44ea09a4c40568cedbf7c1d36cefdb
Author: Bastien Montagne
Date:   Fri Aug 12 18:23:16 2016 +0200
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rB3e24dc367f44ea09a4c40568cedbf7c1d36cefdb

Fix build errors under linux, and cleanup a bunch of warnings.

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

M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/sculpt.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 98da986..cb04808 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -65,7 +65,7 @@
 #include "BKE_report.h"
 #include "BKE_colortools.h"
 #include "BKE_pbvh.h"
-#include "BKE_ccg.h"s
+#include "BKE_ccg.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -827,7 +827,7 @@ static unsigned int vpaint_blend(VPaint *vp, unsigned int col, unsigned int colo
 }
 
 
-static int sample_backbuf_area(ViewContext *vc, int *indexar, int totpoly, int x, int y, float size)
+static int UNUSED_FUNCTION(sample_backbuf_area)(ViewContext *vc, int *indexar, int totpoly, int x, int y, float size)
 {
 	struct ImBuf *ibuf;
 	int a, tot = 0, index;
@@ -974,8 +974,8 @@ static float wpaint_blend_tool(const int tool,
 {
 	switch (tool) {
 		case PAINT_BLEND_MIX:
-    case PAINT_BLEND_AVERAGE:
-    case PAINT_BLEND_SMUDGE:
+		case PAINT_BLEND_AVERAGE:
+		case PAINT_BLEND_SMUDGE:
 		case PAINT_BLEND_BLUR:     return wval_blend(weight, paintval, alpha);
 		case PAINT_BLEND_ADD:      return wval_add(weight, paintval, alpha);
 		case PAINT_BLEND_SUB:      return wval_sub(weight, paintval, alpha);
@@ -991,7 +991,7 @@ static float wpaint_blend_tool(const int tool,
 /* vpaint has 'vpaint_blend' */
 static float wpaint_blend(VPaint *wp, float weight,
                           const float alpha, float paintval,
-                          const float brush_alpha_value,
+                          const float UNUSED(brush_alpha_value),
                           const short do_flip)
 {
 	Brush *brush = BKE_paint_brush(&wp->paint);
@@ -1641,7 +1641,6 @@ static void do_weight_paint_vertex_multi(
 {
 	Mesh *me = ob->data;
 	MDeformVert *dv = &me->dvert[index];
-	MDeformVert *dv_prev = &wp->wpaint_prev[index];
 	bool topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
 
 	/* mirror vars */
@@ -1987,8 +1986,6 @@ static void vwpaint_update_cache_invariants(bContext *C, VPaint *vd, SculptSessi
 	Object *ob = CTX_data_active_object(C);
 	float mat[3][3];
 	float viewDir[3] = { 0.0f, 0.0f, 1.0f };
-	float max_scale;
-	int i;
 	int mode;
 
 	// VW paint needs to allocate stroke cache before update is called.
@@ -2045,11 +2042,9 @@ static void vwpaint_update_cache_invariants(bContext *C, VPaint *vd, SculptSessi
 }
 
 /* Initialize the stroke cache variants from operator properties */
-static void vwpaint_update_cache_variants(bContext *C, VPaint *vd, Object *ob,
-	PointerRNA *ptr)
+static void vwpaint_update_cache_variants(bContext *C, VPaint *vd, Object *ob, PointerRNA *ptr)
 {
 	Scene *scene = CTX_data_scene(C);
-	UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 	SculptSession *ss = ob->sculpt;
 	StrokeCache *cache = ss->cache;
 	Brush *brush = BKE_paint_brush(&vd->paint);
@@ -2135,14 +2130,12 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo
 	Scene *scene = CTX_data_scene(C);
 	struct PaintStroke *stroke = op->customdata;
 	ToolSettings *ts = scene->toolsettings;
-	VPaint *wp = ts->wpaint;
 	Object *ob = CTX_data_active_object(C);
 	Mesh *me = BKE_mesh_from_object(ob);
 	struct WPaintData *wpd;
 	struct WPaintVGroupIndex vgroup_index;
 	int defbase_tot, defbase_tot_sel;
 	bool *defbase_sel;
-	const Brush *brush = BKE_paint_brush(&wp->paint);
 	SculptSession *ss = ob->sculpt;
 	VPaint *vd = CTX_data_tool_settings(C)->wpaint;
 	
@@ -2286,12 +2279,12 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo
 	return true;
 }
 
-static float wpaint_blur_weight_single(const MDeformVert *dv, const WeightPaintInfo *wpi)
+static float UNUSED_FUNCTION(wpaint_blur_weight_single)(const MDeformVert *dv, const WeightPaintInfo *wpi)
 {
 	return defvert_find_weight(dv, wpi->active.index);
 }
 
-static float wpaint_blur_weight_multi(const MDeformVert *dv, const WeightPaintInfo *wpi)
+static float UNUSED_FUNCTION(wpaint_blur_weight_multi)(const MDeformVert *dv, const WeightPaintInfo *wpi)
 {
 	float weight = BKE_defvert_multipaint_collective_weight(
 	        dv, wpi->defbase_tot, wpi->defbase_sel, wpi->defbase_tot_sel, wpi->do_auto_normalize);
@@ -2299,7 +2292,7 @@ static float wpaint_blur_weight_multi(const MDeformVert *dv, const WeightPaintIn
 	return weight;
 }
 
-static float wpaint_blur_weight_calc_from_connected(
+static float UNUSED_FUNCTION(wpaint_blur_weight_calc_from_connected)(
         const MDeformVert *dvert, WeightPaintInfo *wpi, struct WPaintData *wpd, const unsigned int vidx,
         float (*blur_weight_func)(const MDeformVert *, const WeightPaintInfo *))
 {
@@ -2356,7 +2349,6 @@ static void calc_area_normal_and_center_task_cb(void *userdata, const int n)
   BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
   {
     const float *co;
-    const short *no_s;  /* bm_vert only */
 
     co = vd.co;
     
@@ -2410,8 +2402,6 @@ static void calc_area_normal(
   PBVHNode **nodes, int totnode,
   float r_area_no[3])
 {
-  const Brush *brush = BKE_paint_brush(&vp->paint);
-  SculptSession *ss = ob->sculpt;
   int n;
 
   /* 0=towards view, 1=flipped */
@@ -2495,19 +2485,16 @@ static void calc_brushdata_symm(VPaint *vd, StrokeCache *cache, const char symm,
 }
 
 static void do_wpaint_brush_blur_task_cb_ex(
-  void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+  void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
 {
   SculptThreadedTaskData *data = userdata;
   SculptSession *ss = data->ob->sculpt;
-  Scene *scene = CTX_data_scene(data->C);
 
   Brush *brush = data->brush;
   StrokeCache *cache = ss->cache;
   const float bstrength = cache->bstrength;
 
   int totalHitLoops;
-  unsigned int blend[4] = { 0 };
-  char *col;
   double finalColor;
 
   //for each vertex
@@ -2520,9 +2507,7 @@ static void do_wpaint_brush_blur_task_cb_ex(
 
     //Test to see if the vertex coordinates are within the spherical brush region.
     if (sculpt_brush_test(&test, vd.co)) {
-      float dot = dot_vf3vs3(cache->sculpt_normal_symm, vd.no);
-      const float fade = BKE_brush_curve_strength(brush, test.dist, cache->radius);
-      int vertexIndex = vd.vert_indices[vd.i];
+      const int vertexIndex = vd.vert_indices[vd.i];
 
       //Get the average poly color
       totalHitLoops = 0;
@@ -2542,12 +2527,13 @@ static void do_wpaint_brush_blur_task_cb_ex(
         }
       }
       if (totalHitLoops != 0) {
-        finalColor /= totalHitLoops;
-
         const float fade = BKE_brush_curve_strength(brush, test.dist, cache->radius);
-        int vertexIndex = vd.vert_indices[vd.i];
-        if (dot > 0.0)
+		const float dot = dot_vf3vs3(cache->sculpt_normal_symm, vd.no);
+
+		finalColor /= totalHitLoops;
+		if (dot > 0.0) {
           do_weight_paint_vertex(data->vp, data->ob, data->wpi, vertexIndex, dot * fade * bstrength, (float)finalColor);
+		}
       }
     }
     BKE_pbvh_vertex_iter_end;
@@ -2555,7 +2541,7 @@ static void do_wpaint_brush_blur_task_cb_ex(
 }
 
 static void do_wpaint_brush_smudge_task_cb_ex(
-  void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+  void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
 {
   SculptThreadedTaskData *data = userdata;
   SculptSession *ss = data->ob->sculpt;
@@ -2563,8 +2549,6 @@ static void do_wpaint_brush_smudge_task_cb_ex(
   StrokeCache *cache = ss->cache;
   const float bstrength = cache->bstrength;
   bool shouldColor = false;
-  unsigned int *lcol = data->lcol;
-  unsigned int *lcolorig = data->vp->vpaint_prev;
   float finalWeight;
   float brushDirection[3];
   sub_v3_v3v3(brushDirection, cache->location, cache->last_location);
@@ -2581,9 +2565,8 @@ static void do_wpaint_brush_smudge_task_cb_ex(
 
       //Test to see if the vertex coordinates are within the spherical brush region.
       if (sculpt_brush_test(&test, vd.co)) {
-        float dot = dot_vf3vs3(cache->sculpt_normal_symm, vd.no);
-        const float fade = BKE_brush_curve_strength(brush, test.dist, cache->radius);
-        int vertexIndex = vd.vert_indices[vd.i];
+        const float dot = dot_vf3vs3(cache->sculpt_normal_symm, vd.no);
+        const int vertexIndex = vd.vert_indices[vd.i];
         MVert *currentVert = &data->me->mvert[vertexIndex];
 
         //Minimum dot product between brush direction and current to neighbor direction is 0.0, meaning orthogonal.
@@ -2618,7 +2601,6 @@ static void do_wpaint_brush_smudge_task_cb_ex(
         }
         if (shouldColor && dot > 0.0) {
           const float fade = BKE_brush_curve_strength(brush, test.dist, cache->radius);
-          int vertexIndex = vd.vert_indices[vd.i];
           do_weight_paint_vertex(data->vp, data->ob, data->wpi, vertexIndex, dot * fade * bstrength, (float)finalWeight);
         }
       }
@@ -2629,7 +2611,7 @@ static void do_wpaint_brush_smudge_task_cb_ex(
 
 
 static void do_wpaint_brush_draw_task_cb_ex(
-  void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+  void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
 {
   SculptThreadedTaskData *data = userdata;
   SculptSession *ss = data->ob->sculpt;
@@ -2639,7 +2621,6 @@ static void do_wpaint_brush_draw_task_cb_ex(
   StrokeCache *cache = ss->cache;
   const float bstrength = cache->bstrength;
   float paintweight = BKE_brush_weight_get(scene, brush);
-  const float maximum = bstrength;
   
   PBVHVertexIter vd;
   BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
@@ -2657,10 +2638,12 @@ static void do_wpaint_brush_draw_task_cb_ex(
       if (!(data->vp->flag & VP_SPRAY)) {
         MDeformVert *dv = &data->me->dvert[vertexIndex];
         MDeformWeight *dw;
-        dw = (data->vp->flag & VP_ONLYVGROUP) ? dw = defvert_find_index(dv, data->wpi->active.index) :
-                                                     defvert_verify_index(dv, data->wpi->active.index);
+        dw = (data->vp->flag & VP_ONLYVGROUP) ? defvert_find_index(dv, data->wpi->active.index) :
+                                                defvert_verify_index(dv, data->wpi->active.index)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list