minor cleanup and calculate rake angle before jittering or result
authorAntony Riakiotakis <kalast@gmail.com>
Fri, 15 Mar 2013 22:32:44 +0000 (22:32 +0000)
committerAntony Riakiotakis <kalast@gmail.com>
Fri, 15 Mar 2013 22:32:44 +0000 (22:32 +0000)
becomes essentially, random

source/blender/editors/sculpt_paint/paint_stroke.c

index f37b58b9cd9cc5b76d8dd7c2470cc9bc64a9ac6f..66df3a8be330675ddcbc6b2eb62001f07820873d 100644 (file)
@@ -143,11 +143,11 @@ static float event_tablet_data(const wmEvent *event, int *pen_flip)
        return pressure;
 }
 
-#if 1
+
 /* Initialize the stroke cache variants from operator properties */
 static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode,
                                          struct PaintStroke *stroke,
-                                         float mouse[2], float pressure)
+                                                                                const float mouse[2], float pressure)
 {
        Scene *scene = CTX_data_scene(C);
        UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
@@ -234,7 +234,7 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode,
 
        stroke->brush_init = TRUE;
 }
-#endif
+
 
 /* Put the location of the next stroke dot into the stroke RNA and apply it to the mesh */
 static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEvent *event, const float mouse_in[2])
@@ -273,6 +273,8 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEve
         * will create too many dabs */
        copy_v2_v2(stroke->last_mouse_position, mouse_in);
 
+       paint_brush_update(C, brush, mode, stroke, mouse_in, pressure);
+
        /* TODO: as sculpt and other paint modes are unified, this
         * separation will go away */
        if (paint_supports_jitter(mode)) {
@@ -303,8 +305,6 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEve
        else
                zero_v3(location);
 
-       paint_brush_update(C, brush, mode, stroke, mouse_out, pressure);
-
        /* Add to stroke */
        RNA_collection_add(op->ptr, "stroke", &itemptr);