[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22647] branches/blender2.5/blender/source /blender/editors/sculpt_paint: 2.5/Sculpt:

Nicholas Bishop nicholasbishop at gmail.com
Thu Aug 20 07:44:32 CEST 2009


Revision: 22647
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22647
Author:   nicholasbishop
Date:     2009-08-20 07:44:32 +0200 (Thu, 20 Aug 2009)

Log Message:
-----------
2.5/Sculpt:

* Fixed sculpt brush stroke exec (F4 operator)
* Made a generic paint stroke exec

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_intern.h
    branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c

Modified: branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_intern.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_intern.h	2009-08-20 05:13:07 UTC (rev 22646)
+++ branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_intern.h	2009-08-20 05:44:32 UTC (rev 22647)
@@ -49,6 +49,7 @@
 struct PaintStroke *paint_stroke_new(bContext *C, StrokeTestStart test_start,
 				     StrokeUpdateStep update_step, StrokeDone done);
 int paint_stroke_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
+int paint_stroke_exec(struct bContext *C, struct wmOperator *op);
 struct ViewContext *paint_stroke_view_context(struct PaintStroke *stroke);
 void *paint_stroke_mode_data(struct PaintStroke *stroke);
 void paint_stroke_set_mode_data(struct PaintStroke *stroke, void *mode_data);

Modified: branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2009-08-20 05:13:07 UTC (rev 22646)
+++ branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2009-08-20 05:44:32 UTC (rev 22647)
@@ -265,6 +265,21 @@
 		return OPERATOR_RUNNING_MODAL;
 }
 
+int paint_stroke_exec(bContext *C, wmOperator *op)
+{
+	PaintStroke *stroke = op->customdata;
+
+	RNA_BEGIN(op->ptr, itemptr, "stroke") {
+		stroke->update_step(C, stroke, &itemptr);
+	}
+	RNA_END;
+
+	MEM_freeN(stroke);
+	op->customdata = NULL;
+
+	return OPERATOR_FINISHED;
+}
+
 ViewContext *paint_stroke_view_context(PaintStroke *stroke)
 {
 	return &stroke->vc;

Modified: branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c	2009-08-20 05:13:07 UTC (rev 22646)
+++ branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c	2009-08-20 05:44:32 UTC (rev 22647)
@@ -1410,7 +1410,7 @@
 	do_symmetrical_brush_actions(sd, ss);
 
 	/* Cleanup */
-	sculpt_flush_update(C); // XXX: during exec, shouldn't do this every time
+	sculpt_flush_update(C);
 	sculpt_post_stroke_free(ss);
 }
 
@@ -1448,21 +1448,15 @@
 	Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
 	SculptSession *ss = CTX_data_active_object(C)->sculpt;
 
+	op->customdata = paint_stroke_new(C, sculpt_stroke_test_start, sculpt_stroke_update_step, sculpt_stroke_done);
+
 	sculpt_brush_stroke_init(C);
 
 	sculpt_update_cache_invariants(sd, ss, C, op);
 	sculptmode_update_all_projverts(ss);
 
-	RNA_BEGIN(op->ptr, itemptr, "stroke") {
-		sculpt_update_cache_variants(sd, ss, &itemptr);
+	paint_stroke_exec(C, op);
 
-		sculpt_restore_mesh(sd, ss);
-		do_symmetrical_brush_actions(sd, ss);
-
-		sculpt_post_stroke_free(ss);
-	}
-	RNA_END;
-
 	sculpt_flush_update(C);
 	sculpt_cache_free(ss->cache);
 





More information about the Bf-blender-cvs mailing list