[Bf-blender-cvs] [1ec02b86958] master: Cleanup: Renamed PaintOperation.custom_paint to stroke_handle.

Jeroen Bakker noreply at git.blender.org
Tue Feb 22 10:00:48 CET 2022


Commit: 1ec02b869587cf31414f8c2146614bc65a21725b
Author: Jeroen Bakker
Date:   Tue Feb 22 09:13:47 2022 +0100
Branches: master
https://developer.blender.org/rB1ec02b869587cf31414f8c2146614bc65a21725b

Cleanup: Renamed PaintOperation.custom_paint to stroke_handle.

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

M	source/blender/editors/sculpt_paint/paint_image.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 498ba863b92..2df42e6f532 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -315,7 +315,7 @@ typedef enum eTexPaintMode {
 typedef struct PaintOperation {
   eTexPaintMode mode;
 
-  void *custom_paint;
+  void *stroke_handle;
 
   float prevmouse[2];
   float startmouse[2];
@@ -479,14 +479,14 @@ static PaintOperation *texture_paint_init(bContext *C, wmOperator *op, const flo
       return NULL;
     }
     pop->mode = PAINT_MODE_3D_PROJECT;
-    pop->custom_paint = paint_proj_new_stroke(C, ob, mouse, mode);
+    pop->stroke_handle = paint_proj_new_stroke(C, ob, mouse, mode);
   }
   else {
     pop->mode = PAINT_MODE_2D;
-    pop->custom_paint = paint_2d_new_stroke(C, op, mode);
+    pop->stroke_handle = paint_2d_new_stroke(C, op, mode);
   }
 
-  if (!pop->custom_paint) {
+  if (!pop->stroke_handle) {
     MEM_freeN(pop);
     return NULL;
   }
@@ -549,12 +549,12 @@ static void paint_stroke_update_step(bContext *C,
 
   switch (pop->mode) {
     case PAINT_MODE_2D:
-      paint_2d_stroke(pop->custom_paint, pop->prevmouse, mouse, eraser, pressure, distance, size);
+      paint_2d_stroke(pop->stroke_handle, pop->prevmouse, mouse, eraser, pressure, distance, size);
       break;
 
     case PAINT_MODE_3D_PROJECT:
       paint_proj_stroke(
-          C, pop->custom_paint, pop->prevmouse, mouse, eraser, pressure, distance, size);
+          C, pop->stroke_handle, pop->prevmouse, mouse, eraser, pressure, distance, size);
       break;
   }
 
@@ -570,11 +570,11 @@ static void paint_stroke_redraw(const bContext *C, struct PaintStroke *stroke, b
 
   switch (pop->mode) {
     case PAINT_MODE_2D:
-      paint_2d_redraw(C, pop->custom_paint, final);
+      paint_2d_redraw(C, pop->stroke_handle, final);
       break;
 
     case PAINT_MODE_3D_PROJECT:
-      paint_proj_redraw(C, pop->custom_paint, final);
+      paint_proj_redraw(C, pop->stroke_handle, final);
       break;
   }
 }
@@ -592,12 +592,12 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke)
     if (brush->flag & BRUSH_USE_GRADIENT) {
       switch (pop->mode) {
         case PAINT_MODE_2D:
-          paint_2d_gradient_fill(C, brush, pop->startmouse, pop->prevmouse, pop->custom_paint);
+          paint_2d_gradient_fill(C, brush, pop->startmouse, pop->prevmouse, pop->stroke_handle);
           break;
 
         case PAINT_MODE_3D_PROJECT:
           paint_proj_stroke(C,
-                            pop->custom_paint,
+                            pop->stroke_handle,
                             pop->startmouse,
                             pop->prevmouse,
                             paint_stroke_flipped(stroke),
@@ -605,8 +605,8 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke)
                             0.0,
                             BKE_brush_size_get(scene, brush));
           /* two redraws, one for GPU update, one for notification */
-          paint_proj_redraw(C, pop->custom_paint, false);
-          paint_proj_redraw(C, pop->custom_paint, true);
+          paint_proj_redraw(C, pop->stroke_handle, false);
+          paint_proj_redraw(C, pop->stroke_handle, true);
           break;
       }
     }
@@ -621,12 +621,12 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke)
             srgb_to_linearrgb_v3_v3(color, BKE_brush_color_get(scene, brush));
           }
           paint_2d_bucket_fill(
-              C, color, brush, pop->startmouse, pop->prevmouse, pop->custom_paint);
+              C, color, brush, pop->startmouse, pop->prevmouse, pop->stroke_handle);
           break;
 
         case PAINT_MODE_3D_PROJECT:
           paint_proj_stroke(C,
-                            pop->custom_paint,
+                            pop->stroke_handle,
                             pop->startmouse,
                             pop->prevmouse,
                             paint_stroke_flipped(stroke),
@@ -634,8 +634,8 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke)
                             0.0,
                             BKE_brush_size_get(scene, brush));
           /* two redraws, one for GPU update, one for notification */
-          paint_proj_redraw(C, pop->custom_paint, false);
-          paint_proj_redraw(C, pop->custom_paint, true);
+          paint_proj_redraw(C, pop->stroke_handle, false);
+          paint_proj_redraw(C, pop->stroke_handle, true);
           break;
       }
     }
@@ -643,11 +643,11 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke)
 
   switch (pop->mode) {
     case PAINT_MODE_2D:
-      paint_2d_stroke_done(pop->custom_paint);
+      paint_2d_stroke_done(pop->stroke_handle);
       break;
 
     case PAINT_MODE_3D_PROJECT:
-      paint_proj_stroke_done(pop->custom_paint);
+      paint_proj_stroke_done(pop->stroke_handle);
       break;
   }



More information about the Bf-blender-cvs mailing list