[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43513] trunk/blender/source/blender/ editors/sculpt_paint: Remove stroke parameter from PaintStroke' s StrokeGetLocation callback.

Nicholas Bishop nicholasbishop at gmail.com
Thu Jan 19 04:13:11 CET 2012


Revision: 43513
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43513
Author:   nicholasbishop
Date:     2012-01-19 03:13:01 +0000 (Thu, 19 Jan 2012)
Log Message:
-----------
Remove stroke parameter from PaintStroke's StrokeGetLocation callback.

Only affected sculpt.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_intern.h
    trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
    trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
    trunk/blender/source/blender/editors/sculpt_paint/sculpt_intern.h

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c	2012-01-19 02:06:09 UTC (rev 43512)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_cursor.c	2012-01-19 03:13:01 UTC (rev 43513)
@@ -342,7 +342,7 @@
 	window[1] = y + vc->ar->winrct.ymin;
 
 	if(vc->obact->sculpt && vc->obact->sculpt->pbvh &&
-	   sculpt_stroke_get_location(C, NULL, location, window)) {
+	   sculpt_stroke_get_location(C, location, window)) {
 		*pixel_radius =
 			project_brush_radius(vc,
 								 brush_unprojected_radius(scene, brush),

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_intern.h
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_intern.h	2012-01-19 02:06:09 UTC (rev 43512)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_intern.h	2012-01-19 03:13:01 UTC (rev 43513)
@@ -50,7 +50,7 @@
 struct wmOperatorType;
 
 /* paint_stroke.c */
-typedef int (*StrokeGetLocation)(struct bContext *C, struct PaintStroke *stroke, float location[3], float mouse[2]);
+typedef int (*StrokeGetLocation)(struct bContext *C, float location[3], float mouse[2]);
 typedef int (*StrokeTestStart)(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
 typedef void (*StrokeUpdateStep)(struct bContext *C, struct PaintStroke *stroke, struct PointerRNA *itemptr);
 typedef void (*StrokeDone)(struct bContext *C, struct PaintStroke *stroke);

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2012-01-19 02:06:09 UTC (rev 43512)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2012-01-19 03:13:01 UTC (rev 43513)
@@ -163,7 +163,7 @@
 
 	/* TODO: can remove the if statement once all modes have this */
 	if(stroke->get_location)
-		stroke->get_location(C, stroke, location, mouse);
+		stroke->get_location(C, location, mouse);
 	else
 		zero_v3(location);
 

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2012-01-19 02:06:09 UTC (rev 43512)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2012-01-19 03:13:01 UTC (rev 43513)
@@ -3105,7 +3105,7 @@
 			halfway[0] = (float)dx * 0.5f + cache->initial_mouse[0];
 			halfway[1] = (float)dy * 0.5f + cache->initial_mouse[1];
 
-			if (sculpt_stroke_get_location(C, stroke, out, halfway)) {
+			if (sculpt_stroke_get_location(C, out, halfway)) {
 				copy_v3_v3(sd->anchored_location, out);
 				copy_v2_v2(sd->anchored_initial_mouse, halfway);
 				copy_v2_v2(cache->tex_mouse, halfway);
@@ -3207,8 +3207,7 @@
    (This allows us to ignore the GL depth buffer)
    Returns 0 if the ray doesn't hit the mesh, non-zero otherwise
  */
-int sculpt_stroke_get_location(bContext *C, struct PaintStroke *UNUSED(stroke),
-							   float out[3], float mouse[2])
+int sculpt_stroke_get_location(bContext *C, float out[3], float mouse[2])
 {
 	ViewContext vc;
 	Object *ob;
@@ -3220,12 +3219,13 @@
 	SculptRaycastData srd;
 
 	view3d_set_viewcontext(C, &vc);
-	sculpt_stroke_modifiers_check(C, ob);
 	
 	ob = vc.obact;
 	ss = ob->sculpt;
 	cache = ss->cache;
 
+	sculpt_stroke_modifiers_check(C, ob);
+
 	mval[0] = mouse[0] - vc.ar->winrct.xmin;
 	mval[1] = mouse[1] - vc.ar->winrct.ymin;
 
@@ -3377,14 +3377,14 @@
 
 /* Returns whether the mouse/stylus is over the mesh (1)
    or over the background (0) */
-static int over_mesh(bContext *C, struct wmOperator *op, float x, float y)
+static int over_mesh(bContext *C, struct wmOperator *UNUSED(op), float x, float y)
 {
 	float mouse[2], co[3];
 
 	mouse[0] = x;
 	mouse[1] = y;
 
-	return sculpt_stroke_get_location(C, op->customdata, co, mouse);
+	return sculpt_stroke_get_location(C, co, mouse);
 }
 
 static int sculpt_stroke_test_start(bContext *C, struct wmOperator *op,

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt_intern.h
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt_intern.h	2012-01-19 02:06:09 UTC (rev 43512)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt_intern.h	2012-01-19 03:13:01 UTC (rev 43513)
@@ -73,7 +73,7 @@
 void sculpt_stroke_add_point(struct SculptStroke *, const short x, const short y);
 void sculpt_stroke_apply(struct Sculpt *sd, struct SculptStroke *);
 void sculpt_stroke_apply_all(struct Sculpt *sd, struct SculptStroke *);
-int sculpt_stroke_get_location(bContext *C, struct PaintStroke *stroke, float out[3], float mouse[2]);
+int sculpt_stroke_get_location(bContext *C, float out[3], float mouse[2]);
 
 /* Undo */
 



More information about the Bf-blender-cvs mailing list