diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 10:39:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 10:39:04 +0300 |
commit | 95011f6d484b369db92ae13c674a6522d664ea8f (patch) | |
tree | 91ba2719c9f3096fad0f1f768aa7b1c4d79aa32a /source/blender/editors/sculpt_paint/paint_utils.c | |
parent | 0911acb5cf49c5ba05b1df045b41697704aa288a (diff) | |
parent | 44505b38df557a5711703613685a1dec9fc2c3d9 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_utils.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_utils.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 594fbbd04d4..80c4d4099a2 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -221,10 +221,10 @@ void paint_stroke_operator_properties(wmOperatorType *ot) prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); - RNA_def_enum(ot->srna, "mode", stroke_mode_items, BRUSH_STROKE_NORMAL, + RNA_def_enum(ot->srna, "mode", stroke_mode_items, BRUSH_STROKE_NORMAL, "Stroke Mode", "Action taken when a paint stroke is made"); - + } /* 3D Paint */ @@ -436,7 +436,7 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr CLAMP(x, 0, ar->winx); CLAMP(y, 0, ar->winy); - + if (use_palette) { if (!palette) { palette = BKE_palette_add(CTX_data_main(C), "Palette"); @@ -473,12 +473,12 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr if (imapaint_pick_face(&vc, mval, &faceindex, totpoly)) { Image *image; - - if (use_material) + + if (use_material) image = imapaint_face_image(ob_eval, me_eval, faceindex); else image = imapaint->canvas; - + if (image) { ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, NULL); if (ibuf && ibuf->rect) { @@ -486,16 +486,16 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr float u, v; imapaint_pick_uv(me_eval, scene, ob_eval, faceindex, mval, uv); sample_success = true; - + u = fmodf(uv[0], 1.0f); v = fmodf(uv[1], 1.0f); - + if (u < 0.0f) u += 1.0f; if (v < 0.0f) v += 1.0f; - + u = u * ibuf->x; v = v * ibuf->y; - + if (ibuf->rect_float) { float rgba_f[4]; bilinear_interpolation_color_wrap(ibuf, NULL, rgba_f, u, v); @@ -521,7 +521,7 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr } } } - + BKE_image_release_ibuf(image, ibuf, NULL); } } @@ -542,7 +542,7 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr glReadBuffer(GL_BACK); } cp = (unsigned char *)&col; - + if (use_palette) { rgb_uchar_to_float(color->rgb, cp); } |