Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-07-02 13:03:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-02 13:03:56 +0300
commitb076b3853c99d947806e05fe2dec29ca5fa944fa (patch)
tree3d975903096066e33f8cfdcff60e118685deacf8 /source/blender/editors/sculpt_paint
parentad5a20efcef8114b589ff66d09166eabdc8e67ad (diff)
parentb88e51dd55c62bdc160f33f9b2ae1727a892560a (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_curve.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c22
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h32
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c18
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_color_ops.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c12
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h8
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c13
14 files changed, 63 insertions, 62 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 50d178bc757..94111c9939d 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1136,7 +1136,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
/* Public API */
-void paint_cursor_start(bContext *C, int (*poll)(bContext *C))
+void paint_cursor_start(bContext *C, bool (*poll)(bContext *C))
{
Paint *p = BKE_paint_get_active_from_context(C);
@@ -1147,7 +1147,7 @@ void paint_cursor_start(bContext *C, int (*poll)(bContext *C))
BKE_paint_invalidate_overlay_all();
}
-void paint_cursor_start_explicit(Paint *p, wmWindowManager *wm, int (*poll)(bContext *C))
+void paint_cursor_start_explicit(Paint *p, wmWindowManager *wm, bool (*poll)(bContext *C))
{
if (p && !p->paint_cursor)
p->paint_cursor = WM_paint_cursor_activate(wm, poll, paint_draw_cursor, NULL);
diff --git a/source/blender/editors/sculpt_paint/paint_curve.c b/source/blender/editors/sculpt_paint/paint_curve.c
index e2100ceb066..0c3c6e120ed 100644
--- a/source/blender/editors/sculpt_paint/paint_curve.c
+++ b/source/blender/editors/sculpt_paint/paint_curve.c
@@ -57,7 +57,7 @@
#define PAINT_CURVE_SELECT_THRESHOLD 40.0f
#define PAINT_CURVE_POINT_SELECT(pcp, i) (*(&pcp->bez.f1 + i) = SELECT)
-int paint_curve_poll(bContext *C)
+bool paint_curve_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
Paint *p;
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index e2dd043c0c3..02fd685719e 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -268,7 +268,7 @@ static Brush *image_paint_brush(bContext *C)
return BKE_paint_brush(&settings->imapaint.paint);
}
-static int image_paint_poll_ex(bContext *C, bool check_tool)
+static bool image_paint_poll_ex(bContext *C, bool check_tool)
{
Object *obact;
@@ -296,17 +296,17 @@ static int image_paint_poll_ex(bContext *C, bool check_tool)
return 0;
}
-static int image_paint_poll(bContext *C)
+static bool image_paint_poll(bContext *C)
{
return image_paint_poll_ex(C, true);
}
-static int image_paint_ignore_tool_poll(bContext *C)
+static bool image_paint_ignore_tool_poll(bContext *C)
{
return image_paint_poll_ex(C, false);
}
-static int image_paint_2d_clone_poll(bContext *C)
+static bool image_paint_2d_clone_poll(bContext *C)
{
Brush *brush = image_paint_brush(C);
@@ -1039,7 +1039,7 @@ void PAINT_OT_sample_color(wmOperatorType *ot)
/******************** texture paint toggle operator ********************/
-static int texture_paint_toggle_poll(bContext *C)
+static bool texture_paint_toggle_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if (ob == NULL || ob->type != OB_MESH)
@@ -1185,7 +1185,7 @@ static int brush_colors_flip_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
-static int brush_colors_flip_poll(bContext *C)
+static bool brush_colors_flip_poll(bContext *C)
{
if (image_paint_poll(C)) {
Brush *br = image_paint_brush(C);
@@ -1235,7 +1235,7 @@ void ED_imapaint_bucket_fill(struct bContext *C, float color[3], wmOperator *op)
}
-static int texture_paint_poll(bContext *C)
+static bool texture_paint_poll(bContext *C)
{
if (texture_paint_toggle_poll(C))
if (CTX_data_active_object(C)->mode & OB_MODE_TEXTURE_PAINT)
@@ -1244,22 +1244,22 @@ static int texture_paint_poll(bContext *C)
return 0;
}
-int image_texture_paint_poll(bContext *C)
+bool image_texture_paint_poll(bContext *C)
{
return (texture_paint_poll(C) || image_paint_poll(C));
}
-int facemask_paint_poll(bContext *C)
+bool facemask_paint_poll(bContext *C)
{
return BKE_paint_select_face_test(CTX_data_active_object(C));
}
-int vert_paint_poll(bContext *C)
+bool vert_paint_poll(bContext *C)
{
return BKE_paint_select_vert_test(CTX_data_active_object(C));
}
-int mask_paint_poll(bContext *C)
+bool mask_paint_poll(bContext *C)
{
return BKE_paint_select_elem_test(CTX_data_active_object(C));
}
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index f7cac84b728..8c5fdc617c6 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -5803,7 +5803,7 @@ static int add_simple_uvs_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
-static int add_simple_uvs_poll(bContext *C)
+static bool add_simple_uvs_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 8d94978f5c6..a7041a5e9ea 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -87,18 +87,18 @@ struct ViewContext *paint_stroke_view_context(struct PaintStroke *stroke);
void *paint_stroke_mode_data(struct PaintStroke *stroke);
float paint_stroke_distance_get(struct PaintStroke *stroke);
void paint_stroke_set_mode_data(struct PaintStroke *stroke, void *mode_data);
-int paint_poll(struct bContext *C);
-void paint_cursor_start(struct bContext *C, int (*poll)(struct bContext *C));
-void paint_cursor_start_explicit(struct Paint *p, struct wmWindowManager *wm, int (*poll)(struct bContext *C));
+bool paint_poll(struct bContext *C);
+void paint_cursor_start(struct bContext *C, bool (*poll)(struct bContext *C));
+void paint_cursor_start_explicit(struct Paint *p, struct wmWindowManager *wm, bool (*poll)(struct bContext *C));
void paint_cursor_delete_textures(void);
/* paint_vertex.c */
-int weight_paint_poll(struct bContext *C);
-int weight_paint_poll_ignore_tool(bContext *C);
-int weight_paint_mode_poll(struct bContext *C);
-int vertex_paint_poll(struct bContext *C);
-int vertex_paint_poll_ignore_tool(struct bContext *C);
-int vertex_paint_mode_poll(struct bContext *C);
+bool weight_paint_poll(struct bContext *C);
+bool weight_paint_poll_ignore_tool(bContext *C);
+bool weight_paint_mode_poll(struct bContext *C);
+bool vertex_paint_poll(struct bContext *C);
+bool vertex_paint_poll_ignore_tool(struct bContext *C);
+bool vertex_paint_mode_poll(struct bContext *C);
typedef void (*VPaintTransform_Callback)(const float col[3], const void *user_data, float r_col[3]);
@@ -179,7 +179,7 @@ typedef struct ImagePaintPartialRedraw {
#define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS)
#define IMAPAINT_TILE_NUMBER(size) (((size) + IMAPAINT_TILE_SIZE - 1) >> IMAPAINT_TILE_BITS)
-int image_texture_paint_poll(struct bContext *C);
+bool image_texture_paint_poll(struct bContext *C);
void imapaint_image_update(struct SpaceImage *sima, struct Image *image, struct ImBuf *ibuf, short texpaint);
struct ImagePaintPartialRedraw *get_imapaintpartial(void);
void set_imapaintpartial(struct ImagePaintPartialRedraw *ippr);
@@ -238,8 +238,8 @@ struct ListBase *ED_image_undosys_step_get_tiles(struct UndoStep *us_p);
struct ListBase *ED_image_undo_get_tiles(void);
/* sculpt_uv.c */
-int uv_sculpt_poll(struct bContext *C);
-int uv_sculpt_keymap_poll(struct bContext *C);
+bool uv_sculpt_poll(struct bContext *C);
+bool uv_sculpt_keymap_poll(struct bContext *C);
void SCULPT_OT_uv_sculpt_stroke(struct wmOperatorType *ot);
@@ -282,11 +282,11 @@ void PAINT_OT_face_select_reveal(struct wmOperatorType *ot);
void PAINT_OT_vert_select_all(struct wmOperatorType *ot);
void PAINT_OT_vert_select_ungrouped(struct wmOperatorType *ot);
-int vert_paint_poll(struct bContext *C);
-int mask_paint_poll(struct bContext *C);
-int paint_curve_poll(struct bContext *C);
+bool vert_paint_poll(struct bContext *C);
+bool mask_paint_poll(struct bContext *C);
+bool paint_curve_poll(struct bContext *C);
-int facemask_paint_poll(struct bContext *C);
+bool facemask_paint_poll(struct bContext *C);
void flip_v3_v3(float out[3], const float in[3], const char symm);
void flip_qt_qt(float out[3], const float in[3], const char symm);
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 56908811008..e2c39695380 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -184,7 +184,7 @@ static void PALETTE_OT_new(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int palette_poll(bContext *C)
+static bool palette_poll(bContext *C)
{
Paint *paint = BKE_paint_get_active_from_context(C);
@@ -794,7 +794,7 @@ static int stencil_control_modal(bContext *C, wmOperator *op, const wmEvent *eve
return OPERATOR_RUNNING_MODAL;
}
-static int stencil_control_poll(bContext *C)
+static bool stencil_control_poll(bContext *C)
{
ePaintMode mode = BKE_paintmode_get_active_from_context(C);
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 91242b68797..80211c46733 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -1351,7 +1351,7 @@ void paint_stroke_set_mode_data(PaintStroke *stroke, void *mode_data)
stroke->mode_data = mode_data;
}
-int paint_poll(bContext *C)
+bool paint_poll(bContext *C)
{
Paint *p = BKE_paint_get_active_from_context(C);
Object *ob = CTX_data_active_object(C);
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index d6de9c235f1..57306eaff45 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -568,7 +568,7 @@ static int brush_curve_preset_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-static int brush_curve_preset_poll(bContext *C)
+static bool brush_curve_preset_poll(bContext *C)
{
Brush *br = BKE_paint_brush(BKE_paint_get_active_from_context(C));
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 47bcbdb4a08..59a9ee8f0d2 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -201,14 +201,14 @@ static void paint_last_stroke_update(Scene *scene, ARegion *ar, const float mval
/* polling - retrieve whether cursor should be set or operator should be done */
/* Returns true if vertex paint mode is active */
-int vertex_paint_mode_poll(bContext *C)
+bool vertex_paint_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
return ob && ob->mode == OB_MODE_VERTEX_PAINT && ((Mesh *)ob->data)->totpoly;
}
-static int vertex_paint_poll_ex(bContext *C, bool check_tool)
+static bool vertex_paint_poll_ex(bContext *C, bool check_tool)
{
if (vertex_paint_mode_poll(C) &&
BKE_paint_brush(&CTX_data_tool_settings(C)->vpaint->paint))
@@ -226,24 +226,24 @@ static int vertex_paint_poll_ex(bContext *C, bool check_tool)
return 0;
}
-int vertex_paint_poll(bContext *C)
+bool vertex_paint_poll(bContext *C)
{
return vertex_paint_poll_ex(C, true);
}
-int vertex_paint_poll_ignore_tool(bContext *C)
+bool vertex_paint_poll_ignore_tool(bContext *C)
{
return vertex_paint_poll_ex(C, true);
}
-int weight_paint_mode_poll(bContext *C)
+bool weight_paint_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
return ob && ob->mode == OB_MODE_WEIGHT_PAINT && ((Mesh *)ob->data)->totpoly;
}
-static int weight_paint_poll_ex(bContext *C, bool check_tool)
+static bool weight_paint_poll_ex(bContext *C, bool check_tool)
{
Object *ob = CTX_data_active_object(C);
ScrArea *sa;
@@ -264,12 +264,12 @@ static int weight_paint_poll_ex(bContext *C, bool check_tool)
return 0;
}
-int weight_paint_poll(bContext *C)
+bool weight_paint_poll(bContext *C)
{
return weight_paint_poll_ex(C, true);
}
-int weight_paint_poll_ignore_tool(bContext *C)
+bool weight_paint_poll_ignore_tool(bContext *C)
{
return weight_paint_poll_ex(C, false);
}
@@ -1282,7 +1282,7 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
}
/* for switching to/from mode */
-static int paint_poll_test(bContext *C)
+static bool paint_poll_test(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if (ob == NULL || ob->type != OB_MESH)
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
index 8516d92214d..4c8ca493cd1 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
@@ -49,7 +49,7 @@
#include "paint_intern.h" /* own include */
-static int vertex_weight_paint_mode_poll(bContext *C)
+static bool vertex_weight_paint_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
Mesh *me = BKE_mesh_from_object(ob);
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
index 126b3b42e8f..d19a1d3a189 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
@@ -117,7 +117,7 @@ static void wpaint_prev_destroy(struct WPaintPrev *wpp)
/** \name Weight from Bones Operator
* \{ */
-static int weight_from_bones_poll(bContext *C)
+static bool weight_from_bones_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 88cb6f548e8..a5871c90d56 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4082,25 +4082,25 @@ static void sculpt_update_tex(const Scene *scene, Sculpt *sd, SculptSession *ss)
-int sculpt_mode_poll(bContext *C)
+bool sculpt_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
return ob && ob->mode & OB_MODE_SCULPT;
}
-int sculpt_mode_poll_view3d(bContext *C)
+bool sculpt_mode_poll_view3d(bContext *C)
{
return (sculpt_mode_poll(C) &&
CTX_wm_region_view3d(C));
}
-int sculpt_poll_view3d(bContext *C)
+bool sculpt_poll_view3d(bContext *C)
{
return (sculpt_poll(C) &&
CTX_wm_region_view3d(C));
}
-int sculpt_poll(bContext *C)
+bool sculpt_poll(bContext *C)
{
return sculpt_mode_poll(C) && paint_poll(C);
}
@@ -5537,7 +5537,7 @@ static int sculpt_optimize_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
-static int sculpt_and_dynamic_topology_poll(bContext *C)
+static bool sculpt_and_dynamic_topology_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
@@ -5853,7 +5853,7 @@ static void SCULPT_OT_sculptmode_toggle(wmOperatorType *ot)
}
-static int sculpt_and_dynamic_topology_constant_detail_poll(bContext *C)
+static bool sculpt_and_dynamic_topology_constant_detail_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index ff6b5a6f374..2154061da1b 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -48,11 +48,11 @@ struct Object;
struct SculptUndoNode;
struct SculptOrigVertData;
-int sculpt_mode_poll(struct bContext *C);
-int sculpt_mode_poll_view3d(struct bContext *C);
+bool sculpt_mode_poll(struct bContext *C);
+bool sculpt_mode_poll_view3d(struct bContext *C);
/* checks for a brush, not just sculpt mode */
-int sculpt_poll(struct bContext *C);
-int sculpt_poll_view3d(struct bContext *C);
+bool sculpt_poll(struct bContext *C);
+bool sculpt_poll_view3d(struct bContext *C);
/* Stroke */
bool sculpt_stroke_get_location(struct bContext *C, float out[3], const float mouse[2]);
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index 1405de8cfa9..29b258fc80d 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -160,7 +160,7 @@ static Brush *uv_sculpt_brush(bContext *C)
}
-static int uv_sculpt_brush_poll_do(bContext *C, const bool check_region)
+static bool uv_sculpt_brush_poll_do(bContext *C, const bool check_region)
{
BMEditMesh *em;
int ret;
@@ -188,7 +188,7 @@ static int uv_sculpt_brush_poll_do(bContext *C, const bool check_region)
return ret;
}
-static int uv_sculpt_brush_poll(bContext *C)
+static bool uv_sculpt_brush_poll(bContext *C)
{
return uv_sculpt_brush_poll_do(C, true);
}
@@ -247,8 +247,9 @@ void ED_space_image_uv_sculpt_update(Main *bmain, wmWindowManager *wm, Scene *sc
BKE_paint_init(bmain, scene, ePaintSculptUV, PAINT_CURSOR_SCULPT);
- settings->uvsculpt->paint.paint_cursor = WM_paint_cursor_activate(wm, uv_sculpt_brush_poll,
- brush_drawcursor_uvsculpt, NULL);
+ settings->uvsculpt->paint.paint_cursor = WM_paint_cursor_activate(
+ wm, uv_sculpt_brush_poll,
+ brush_drawcursor_uvsculpt, NULL);
}
else {
if (settings->uvsculpt) {
@@ -258,12 +259,12 @@ void ED_space_image_uv_sculpt_update(Main *bmain, wmWindowManager *wm, Scene *sc
}
}
-int uv_sculpt_poll(bContext *C)
+bool uv_sculpt_poll(bContext *C)
{
return uv_sculpt_brush_poll_do(C, true);
}
-int uv_sculpt_keymap_poll(bContext *C)
+bool uv_sculpt_keymap_poll(bContext *C)
{
return uv_sculpt_brush_poll_do(C, false);
}