diff options
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c76ad1570b3..34a347979a8 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -73,6 +73,8 @@ #include "BKE_unit.h" #include "BKE_paint.h" +#include "DEG_depsgraph.h" + #include "ED_screen.h" #include "ED_util.h" #include "ED_keyframing.h" @@ -5230,10 +5232,12 @@ static int ui_do_but_COLOR( if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { if ((int)(but->a1) == UI_PALETTE_COLOR) { if (!event->ctrl) { + EvaluationContext eval_ctx; + CTX_data_eval_ctx(C, &eval_ctx); float color[3]; Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Paint *paint = BKE_paint_get_active(scene, view_layer); + Paint *paint = BKE_paint_get_active(scene, view_layer, eval_ctx.object_mode); Brush *brush = BKE_paint_brush(paint); if (brush->flag & BRUSH_USE_GRADIENT) { |