Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_image_proj.c
| Show First 20 Lines • Show All 5,361 Lines • ▼ Show 20 Lines | static void paint_proj_stroke_ps( | ||||
| Scene *scene = ps->scene; | Scene *scene = ps->scene; | ||||
| ps->brush_size = size; | ps->brush_size = size; | ||||
| ps->blend = brush->blend; | ps->blend = brush->blend; | ||||
| if (eraser) | if (eraser) | ||||
| ps->blend = IMB_BLEND_ERASE_ALPHA; | ps->blend = IMB_BLEND_ERASE_ALPHA; | ||||
| /* handle gradient and inverted stroke color here */ | /* handle gradient and inverted stroke color here */ | ||||
| if (ps->tool == PAINT_TOOL_DRAW) { | if (ELEM(ps->tool, PAINT_TOOL_DRAW, PAINT_TOOL_FILL)) { | ||||
| paint_brush_color_get(scene, brush, false, ps->mode == BRUSH_STROKE_INVERT, distance, pressure, ps->paint_color, NULL); | paint_brush_color_get(scene, brush, false, ps->mode == BRUSH_STROKE_INVERT, distance, pressure, ps->paint_color, NULL); | ||||
| if (ps->use_colormanagement) { | if (ps->use_colormanagement) { | ||||
| srgb_to_linearrgb_v3_v3(ps->paint_color_linear, ps->paint_color); | srgb_to_linearrgb_v3_v3(ps->paint_color_linear, ps->paint_color); | ||||
| } | } | ||||
| else { | else { | ||||
| copy_v3_v3(ps->paint_color_linear, ps->paint_color); | copy_v3_v3(ps->paint_color_linear, ps->paint_color); | ||||
| } | } | ||||
| } | } | ||||
| else if (ps->tool == PAINT_TOOL_FILL) { | |||||
| copy_v3_v3(ps->paint_color, BKE_brush_color_get(scene, brush)); | |||||
| if (ps->use_colormanagement) { | |||||
| srgb_to_linearrgb_v3_v3(ps->paint_color_linear, ps->paint_color); | |||||
| } | |||||
| else { | |||||
| copy_v3_v3(ps->paint_color_linear, ps->paint_color); | |||||
| } | |||||
| } | |||||
| else if (ps->tool == PAINT_TOOL_MASK) { | else if (ps->tool == PAINT_TOOL_MASK) { | ||||
| ps->stencil_value = brush->weight; | ps->stencil_value = brush->weight; | ||||
| if ((ps->mode == BRUSH_STROKE_INVERT) ^ | if ((ps->mode == BRUSH_STROKE_INVERT) ^ | ||||
| ((scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_STENCIL_INV) != 0)) | ((scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_STENCIL_INV) != 0)) | ||||
| { | { | ||||
| ps->stencil_value = 1.0f - ps->stencil_value; | ps->stencil_value = 1.0f - ps->stencil_value; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,012 Lines • Show Last 20 Lines | |||||