Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_image.c
| Show First 20 Lines • Show All 579 Lines • ▼ Show 20 Lines | if (brush->flag & BRUSH_USE_GRADIENT) { | ||||
| /* two redraws, one for GPU update, one for notification */ | /* two redraws, one for GPU update, one for notification */ | ||||
| paint_proj_redraw(C, pop->custom_paint, false); | paint_proj_redraw(C, pop->custom_paint, false); | ||||
| paint_proj_redraw(C, pop->custom_paint, true); | paint_proj_redraw(C, pop->custom_paint, true); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| if (pop->mode == PAINT_MODE_2D) { | if (pop->mode == PAINT_MODE_2D) { | ||||
| float color[3]; | float color[3]; | ||||
| if (paint_stroke_inverted(stroke)) { | |||||
| srgb_to_linearrgb_v3_v3(color, BKE_brush_secondary_color_get(scene, brush)); | |||||
| } | |||||
| else { | |||||
| srgb_to_linearrgb_v3_v3(color, BKE_brush_color_get(scene, brush)); | srgb_to_linearrgb_v3_v3(color, BKE_brush_color_get(scene, brush)); | ||||
| } | |||||
| paint_2d_bucket_fill(C, color, brush, pop->prevmouse, pop->custom_paint); | paint_2d_bucket_fill(C, color, brush, pop->prevmouse, pop->custom_paint); | ||||
| } | } | ||||
| else { | else { | ||||
| paint_proj_stroke( | paint_proj_stroke( | ||||
| C, pop->custom_paint, pop->startmouse, pop->prevmouse, paint_stroke_flipped(stroke), | C, pop->custom_paint, pop->startmouse, pop->prevmouse, paint_stroke_flipped(stroke), | ||||
| 1.0, 0.0, BKE_brush_size_get(scene, brush)); | 1.0, 0.0, BKE_brush_size_get(scene, brush)); | ||||
| /* two redraws, one for GPU update, one for notification */ | /* two redraws, one for GPU update, one for notification */ | ||||
| paint_proj_redraw(C, pop->custom_paint, false); | paint_proj_redraw(C, pop->custom_paint, false); | ||||
| ▲ Show 20 Lines • Show All 593 Lines • ▼ Show 20 Lines | static int brush_colors_flip_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static bool brush_colors_flip_poll(bContext *C) | static bool brush_colors_flip_poll(bContext *C) | ||||
| { | { | ||||
| if (image_paint_poll(C)) { | if (image_paint_poll(C)) { | ||||
| Brush *br = image_paint_brush(C); | Brush *br = image_paint_brush(C); | ||||
| if (br->imagepaint_tool == PAINT_TOOL_DRAW) | if (ELEM(br->imagepaint_tool, PAINT_TOOL_DRAW, PAINT_TOOL_FILL)) | ||||
| return true; | return true; | ||||
| } | } | ||||
| else { | else { | ||||
| Object *ob = CTX_data_active_object(C); | Object *ob = CTX_data_active_object(C); | ||||
| if (ob != NULL) { | if (ob != NULL) { | ||||
| if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_TEXTURE_PAINT)) { | if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_TEXTURE_PAINT)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines | |||||