diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-06-30 09:11:24 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-06-30 09:11:24 +0300 |
commit | f7c6d3705df8c182d70ca8ca12bb8ac160cdba8f (patch) | |
tree | 9b4256d0cbc0f61dad282fa9793b3b64ff9cf18a /source/blender/editors/sculpt_paint | |
parent | 3cefa13770a1a76f223e3183c494edf533739a2e (diff) |
Cleanup: Renamed SCULPT_TOOL_NEEDS_COLOR to SCULPT_tool_is_paint
Old name is confusing since SCULPT_TOOL_PAINT can paint
on images too, and it's planned for smear to as well.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 14 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_intern.h | 5 |
2 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index cbf7701efe9..41bc82874ae 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3219,7 +3219,7 @@ static void do_brush_action_task_cb(void *__restrict userdata, SCULPT_undo_push_node(data->ob, data->nodes[n], SCULPT_UNDO_MASK); BKE_pbvh_node_mark_update_mask(data->nodes[n]); } - else if (SCULPT_TOOL_NEEDS_COLOR(data->brush->sculpt_tool)) { + else if (SCULPT_tool_is_paint(data->brush->sculpt_tool)) { SCULPT_undo_push_node(data->ob, data->nodes[n], SCULPT_UNDO_COLOR); BKE_pbvh_node_mark_update_color(data->nodes[n]); } @@ -3246,7 +3246,7 @@ static void do_brush_action(Sculpt *sd, /* Check for unsupported features. */ PBVHType type = BKE_pbvh_type(ss->pbvh); - if (SCULPT_TOOL_NEEDS_COLOR(brush->sculpt_tool) && SCULPT_has_loop_colors(ob)) { + if (SCULPT_tool_is_paint(brush->sculpt_tool) && SCULPT_has_loop_colors(ob)) { if (type != PBVH_FACES) { return; } @@ -4693,8 +4693,8 @@ static bool sculpt_needs_connectivity_info(const Sculpt *sd, (brush->sculpt_tool == SCULPT_TOOL_POSE) || (brush->sculpt_tool == SCULPT_TOOL_BOUNDARY) || (brush->sculpt_tool == SCULPT_TOOL_SLIDE_RELAX) || - SCULPT_TOOL_NEEDS_COLOR(brush->sculpt_tool) || - (brush->sculpt_tool == SCULPT_TOOL_CLOTH) || (brush->sculpt_tool == SCULPT_TOOL_SMEAR) || + SCULPT_tool_is_paint(brush->sculpt_tool) || (brush->sculpt_tool == SCULPT_TOOL_CLOTH) || + (brush->sculpt_tool == SCULPT_TOOL_SMEAR) || (brush->sculpt_tool == SCULPT_TOOL_DRAW_FACE_SETS) || (brush->sculpt_tool == SCULPT_TOOL_DISPLACEMENT_SMEAR) || (brush->sculpt_tool == SCULPT_TOOL_PAINT)); @@ -5069,7 +5069,7 @@ static void sculpt_brush_stroke_init(bContext *C, wmOperator *op) sculpt_brush_init_tex(sd, ss); need_pmap = sculpt_needs_connectivity_info(sd, brush, ss, mode); - needs_colors = SCULPT_TOOL_NEEDS_COLOR(brush->sculpt_tool); + needs_colors = SCULPT_tool_is_paint(brush->sculpt_tool); if (needs_colors) { BKE_sculpt_color_layer_create_if_needed(ob); @@ -5316,7 +5316,7 @@ static bool sculpt_stroke_test_start(bContext *C, struct wmOperator *op, const f /* NOTE: This should be removed when paint mode is available. Paint mode can force based on the * canvas it is painting on. (ref. use_sculpt_texture_paint). */ - if (brush && SCULPT_TOOL_NEEDS_COLOR(brush->sculpt_tool)) { + if (brush && SCULPT_tool_is_paint(brush->sculpt_tool)) { View3D *v3d = CTX_wm_view3d(C); if (v3d->shading.type == OB_SOLID) { v3d->shading.color_type = V3D_SHADING_VERTEX_COLOR; @@ -5501,7 +5501,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent Sculpt *sd = CTX_data_tool_settings(C)->sculpt; Brush *brush = BKE_paint_brush(&sd->paint); - if (SCULPT_TOOL_NEEDS_COLOR(brush->sculpt_tool) && + if (SCULPT_tool_is_paint(brush->sculpt_tool) && !SCULPT_handles_colors_report(ob->sculpt, op->reports)) { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 2c4f2f7370a..8485c7fcbf9 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -1805,7 +1805,10 @@ void SCULPT_OT_brush_stroke(struct wmOperatorType *ot); /* end sculpt_ops.c */ -#define SCULPT_TOOL_NEEDS_COLOR(tool) ELEM(tool, SCULPT_TOOL_PAINT, SCULPT_TOOL_SMEAR) +BLI_INLINE bool SCULPT_tool_is_paint(int tool) +{ + return ELEM(tool, SCULPT_TOOL_PAINT, SCULPT_TOOL_SMEAR); +} #ifdef __cplusplus } |