Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-07-30 08:37:45 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-07-30 08:37:45 +0300
commitd2063f7bc35ee9bb3f01e6cb9f5ca4b09d414bff (patch)
tree61c4c09ff089a35d84f2efa694f3cc515deb4eb7 /source/blender/editors/sculpt_paint/paint_image.c
parent369b574fd5ae9522133344ecddab4fff5ee50225 (diff)
Fix edit-mode interfering with brush swap color
D5353 by @robert-wallis
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 41dfd6f68c3..a0f578c04d0 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -1246,8 +1246,7 @@ static int brush_colors_flip_exec(bContext *C, wmOperator *UNUSED(op))
Scene *scene = CTX_data_scene(C);
UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
- ViewLayer *view_layer = CTX_data_view_layer(C);
- Paint *paint = BKE_paint_get_active(scene, view_layer);
+ Paint *paint = BKE_paint_get_active_from_context(C);
Brush *br = BKE_paint_brush(paint);
if (ups->flag & UNIFIED_PAINT_COLOR) {
@@ -1256,6 +1255,10 @@ static int brush_colors_flip_exec(bContext *C, wmOperator *UNUSED(op))
else if (br) {
swap_v3_v3(br->rgb, br->secondary_rgb);
}
+ else {
+ return OPERATOR_CANCELLED;
+ }
+
WM_event_add_notifier(C, NC_BRUSH | NA_EDITED, br);
return OPERATOR_FINISHED;