diff options
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 70fd57830c0..77c9dcf8ac6 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -222,10 +222,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"); @@ -471,12 +471,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, me, faceindex); else image = imapaint->canvas; - + if (image) { ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, NULL); if (ibuf && ibuf->rect) { @@ -484,16 +484,16 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr float u, v; imapaint_pick_uv(scene, ob, 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]; if (U.gameflags & USER_DISABLE_MIPMAP) @@ -525,7 +525,7 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr } } } - + BKE_image_release_ibuf(image, ibuf, NULL); } } @@ -547,7 +547,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); } |