Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Mon, 2 Jul 2018 16:48:24 +0000 (18:48 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 2 Jul 2018 16:55:24 +0000 (18:55 +0200)
14 files changed:
1  2 
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_curve.c
source/blender/editors/sculpt_paint/paint_hide.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_image_2d.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_image_undo.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_mask.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c

index 02fd685719e72c938094d6f9b38dd96a5907310b,ab04a9275738f515cd225da32fafd1956a26176d..7f71270c52df46ef4398510b91fe75aebce78bdd
@@@ -882,12 -851,13 +888,13 @@@ static void sample_color_update_header(
        ScrArea *sa = CTX_wm_area(C);
  
        if (sa) {
-               BLI_snprintf(msg, sizeof(msg),
-                            IFACE_("Sample color for %s"),
-                            !data->sample_palette ?
-                            IFACE_("Brush. Use Left Click to sample for palette instead") :
-                            IFACE_("Palette. Use Left Click to sample more colors"));
+               BLI_snprintf(
+                       msg, sizeof(msg),
+                       IFACE_("Sample color for %s"),
+                       !data->sample_palette ?
+                       IFACE_("Brush. Use Left Click to sample for palette instead") :
+                       IFACE_("Palette. Use Left Click to sample more colors"));
 -              ED_area_headerprint(sa, msg);
 +              ED_workspace_status_text(C, msg);
        }
  }
  
index a75d634484973a7ac514ae90dbf5cc3d65b547e6,76190b13b61b09913c846ebac3ba0556f25747ea..da08766b3222866d30f1e82b4f1ac527587aa789
@@@ -862,8 -865,8 +866,9 @@@ static void paint_2d_lift_soften(ImageP
        out_off[0] = out_off[1] = 0;
  
        if (!tile) {
--              IMB_rectclip(ibuf, ibufb, &in_off[0], &in_off[1], &out_off[0],
--                           &out_off[1], &dim[0], &dim[1]);
++              IMB_rectclip(
++                      ibuf, ibufb, &in_off[0], &in_off[1], &out_off[0],
++                      &out_off[1], &dim[0], &dim[1]);
  
                if ((dim[0] == 0) || (dim[1] == 0))
                        return;
index 8c5fdc617c6707fe8c6eb60c845f0c43914e4fe6,6b13decd41ba33d8811265e492f8805e40c7f6c3..04329697b547863b7d99b8ebb32541acf9510649
@@@ -2603,9 -2599,21 +2603,10 @@@ static void project_paint_face_init
  #endif
  
                if (pixel_bounds_array(uv_clip, &bounds_px, ibuf->x, ibuf->y, uv_clip_tot)) {
 -
 -                      if (clamp_u) {
 -                              CLAMP(bounds_px.xmin, 0, ibuf->x);
 -                              CLAMP(bounds_px.xmax, 0, ibuf->x);
 -                      }
 -
 -                      if (clamp_v) {
 -                              CLAMP(bounds_px.ymin, 0, ibuf->y);
 -                              CLAMP(bounds_px.ymax, 0, ibuf->y);
 -                      }
 -
  #if 0
-                       project_paint_undo_tiles_init(&bounds_px, ps->projImages + image_index, tmpibuf,
-                                                     tile_width, threaded, ps->do_masking);
+                       project_paint_undo_tiles_init(
+                               &bounds_px, ps->projImages + image_index, tmpibuf,
+                               tile_width, threaded, ps->do_masking);
  #endif
                        /* clip face and */
  
index a7041a5e9eae33620518f0d9e53c854dc497f9a4,b782a47192a71d72c1bb6273e3d0adc52562d237..7d3049434d6b1a79fe3e56314b051427a36c6f88
@@@ -65,10 -65,10 +65,11 @@@ typedef void (*StrokeUpdateStep)(struc
  typedef void (*StrokeRedraw)(const struct bContext *C, struct PaintStroke *stroke, bool final);
  typedef void (*StrokeDone)(const struct bContext *C, struct PaintStroke *stroke);
  
--struct PaintStroke *paint_stroke_new(struct bContext *C, struct wmOperator *op,
--                                     StrokeGetLocation get_location, StrokeTestStart test_start,
--                                     StrokeUpdateStep update_step, StrokeRedraw redraw,
--                                     StrokeDone done, int event_type);
++struct PaintStroke *paint_stroke_new(
++        struct bContext *C, struct wmOperator *op,
++        StrokeGetLocation get_location, StrokeTestStart test_start,
++        StrokeUpdateStep update_step, StrokeRedraw redraw,
++        StrokeDone done, int event_type);
  void paint_stroke_data_free(struct wmOperator *op);
  
  bool paint_space_stroke_enabled(struct Brush *br, enum ePaintMode mode);
@@@ -248,20 -247,21 +249,22 @@@ void SCULPT_OT_uv_sculpt_stroke(struct 
  /* Convert the object-space axis-aligned bounding box (expressed as
   * its minimum and maximum corners) into a screen-space rectangle,
   * returns zero if the result is empty */
--bool paint_convert_bb_to_rect(struct rcti *rect,
--                              const float bb_min[3],
--                              const float bb_max[3],
--                              const struct ARegion *ar,
--                              struct RegionView3D *rv3d,
--                              struct Object *ob);
++bool paint_convert_bb_to_rect(
++        struct rcti *rect,
++        const float bb_min[3],
++        const float bb_max[3],
++        const struct ARegion *ar,
++        struct RegionView3D *rv3d,
++        struct Object *ob);
  
  /* Get four planes in object-space that describe the projection of
   * screen_rect from screen into object-space (essentially converting a
   * 2D screens-space bounding box into four 3D planes) */
--void paint_calc_redraw_planes(float planes[4][4],
--                              const struct ARegion *ar,
 -                              struct RegionView3D *rv3d,
--                              struct Object *ob,
--                              const struct rcti *screen_rect);
++void paint_calc_redraw_planes(
++        float planes[4][4],
++        const struct ARegion *ar,
++        struct Object *ob,
++        const struct rcti *screen_rect);
  
  float paint_calc_object_space_radius(struct ViewContext *vc, const float center[3], float pixel_radius);
  float paint_get_tex_pixel(const struct MTex *mtex, float u, float v, struct ImagePool *pool, int thread);
@@@ -307,8 -309,8 +312,9 @@@ typedef enum 
        RC_COLOR_OVERRIDE = 32,
  } RCFlags;
  
--void set_brush_rc_props(struct PointerRNA *ptr, const char *paint, const char *prop, const char *secondary_prop,
--                        RCFlags flags);
++void set_brush_rc_props(
++        struct PointerRNA *ptr, const char *paint, const char *prop, const char *secondary_prop,
++        RCFlags flags);
  
  /* paint_hide.c */
  
index f89236dbbc12c1ea350db55222844790b862426f,b42a825ad7c6e2e8a6deb3e2fd42527370cc8ca1..9f14a82161377ed3c692d6f320cc57d0ba9fcbed
@@@ -1335,9 -1344,9 +1340,8 @@@ void ED_keymap_paint(wmKeyConfig *keyco
        WM_keymap_add_item(keymap, "PAINT_OT_brush_colors_flip", XKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "PAINT_OT_sample_color", SKEY, KM_PRESS, 0, 0);
  
-       WM_keymap_add_item(keymap,
-                          "PAINT_OT_vertex_color_set", KKEY, KM_PRESS, KM_SHIFT, 0);
+       WM_keymap_add_item(keymap, "PAINT_OT_vertex_color_set", KKEY, KM_PRESS, KM_SHIFT, 0);
  
 -      ed_keymap_paint_brush_switch(keymap, "vertex_paint");
        ed_keymap_paint_brush_size(keymap, "tool_settings.vertex_paint.brush.size");
        ed_keymap_paint_brush_radial_control(keymap, "vertex_paint", RC_COLOR | RC_COLOR_OVERRIDE | RC_ROTATION);
  
        RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_gradient", LEFTMOUSE, KM_PRESS, KM_ALT, 0)->ptr,           "type", WPAINT_GRADIENT_TYPE_LINEAR);
        RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_gradient", LEFTMOUSE, KM_PRESS, KM_ALT | KM_CTRL, 0)->ptr, "type", WPAINT_GRADIENT_TYPE_RADIAL);
  
-       WM_keymap_add_item(keymap,
-                          "PAINT_OT_weight_set", KKEY, KM_PRESS, KM_SHIFT, 0);
+       WM_keymap_add_item(keymap, "PAINT_OT_weight_set", KKEY, KM_PRESS, KM_SHIFT, 0);
  
 -      ed_keymap_paint_brush_switch(keymap, "weight_paint");
        ed_keymap_paint_brush_size(keymap, "tool_settings.weight_paint.brush.size");
        ed_keymap_paint_brush_radial_control(keymap, "weight_paint", RC_WEIGHT);
  
index 99b319f422afd17f16183c4a9883ecd79b40a932,71b63ccbdffd1deb604197ac74ce287e5b057d8c..697ffc327594cd4261582a5ffe4a24a9cc8b1c5f
@@@ -133,14 -129,20 +134,15 @@@ bool paint_convert_bb_to_rect
  /* Get four planes in object-space that describe the projection of
   * screen_rect from screen into object-space (essentially converting a
   * 2D screens-space bounding box into four 3D planes) */
- void paint_calc_redraw_planes(float planes[4][4],
-                               const ARegion *ar,
-                               Object *ob,
-                               const rcti *screen_rect)
+ void paint_calc_redraw_planes(
+         float planes[4][4],
+         const ARegion *ar,
 -        RegionView3D *rv3d,
+         Object *ob,
+         const rcti *screen_rect)
  {
        BoundBox bb;
 -      bglMats mats;
        rcti rect;
  
 -      memset(&bb, 0, sizeof(BoundBox));
 -      view3d_get_transformation(ar, rv3d, ob, &mats);
 -
        /* use some extra space just in case */
        rect = *screen_rect;
        rect.xmin -= 2;
index d19a1d3a189650a32f4fad13d865285d10162644,1a37973cd7d81412a0c59470bb21da05ebbdcabb..436f4ac5993b41cea953d2e388a43dfed061855d
@@@ -642,10 -640,10 +643,11 @@@ static void gradientVertInit__mapFunc
                 * updating the mesh may move them about (entering feedback loop) */
  
                if (BLI_BITMAP_TEST(grad_data->vert_visit, index) == 0) {
 -                      DMGradient_vertStore *vs = &grad_data->vert_cache->elem[index];
 -                      if (ED_view3d_project_float_object(grad_data->ar,
 -                                                         co, vs->sco,
 -                                                         V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
 +                      WPGradient_vertStore *vs = &grad_data->vert_cache->elem[index];
-                       if (ED_view3d_project_float_object(grad_data->ar,
-                                                          co, vs->sco,
-                                                          V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
++                      if (ED_view3d_project_float_object(
++                                  grad_data->ar,
++                                  co, vs->sco,
++                                  V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
                        {
                                /* ok */
                                MDeformVert *dv = &me->dvert[index];