[Bf-blender-cvs] [7f24b34] master: Fix T38885: missing image editor paint brush updates after recent UI changes.
Brecht Van Lommel
noreply at git.blender.org
Fri Feb 28 18:13:32 CET 2014
Commit: 7f24b34dcc78376fff7d81119e23f16f3429c58f
Author: Brecht Van Lommel
Date: Fri Feb 28 18:12:05 2014 +0100
https://developer.blender.org/rB7f24b34dcc78376fff7d81119e23f16f3429c58f
Fix T38885: missing image editor paint brush updates after recent UI changes.
===================================================================
M source/blender/editors/sculpt_paint/paint_image.c
M source/blender/editors/space_image/space_image.c
===================================================================
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 56cba57..1b2e708 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -960,6 +960,7 @@ static int sample_color_exec(bContext *C, wmOperator *op)
static int sample_color_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
Paint *paint = BKE_paint_get_active_from_context(C);
+ Brush *brush = BKE_paint_brush(paint);
SampleColorData *data = MEM_mallocN(sizeof(SampleColorData), "sample color custom data");
ARegion *ar = CTX_wm_region(C);
wmWindow *win = CTX_wm_window(C);
@@ -977,6 +978,7 @@ static int sample_color_invoke(bContext *C, wmOperator *op, const wmEvent *event
paint_sample_color(C, ar, event->mval[0], event->mval[1]);
WM_event_add_modal_handler(C, op);
+ WM_event_add_notifier(C, NC_BRUSH | NA_EDITED, brush);
return OPERATOR_RUNNING_MODAL;
}
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index e857583..5c9fd23 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -789,20 +789,28 @@ static void image_buttons_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa)
{
/* context changes */
switch (wmn->category) {
- case NC_GPENCIL:
- if (wmn->data == ND_DATA)
- ED_region_tag_redraw(ar);
- break;
- case NC_BRUSH:
- if (wmn->action == NA_EDITED)
- ED_region_tag_redraw(ar);
- break;
case NC_TEXTURE:
case NC_MATERIAL:
/* sending by texture render job and needed to properly update displaying
* brush texture icon */
ED_region_tag_redraw(ar);
break;
+ case NC_SCENE:
+ switch (wmn->data) {
+ case ND_MODE:
+ case ND_RENDER_RESULT:
+ case ND_COMPO_RESULT:
+ ED_region_tag_redraw(ar);
+ break;
+ }
+ break;
+ case NC_IMAGE:
+ if (wmn->action != NA_PAINTING)
+ ED_region_tag_redraw(ar);
+ break;
+ case NC_NODE:
+ ED_region_tag_redraw(ar);
+ break;
}
}
@@ -850,6 +858,14 @@ static void image_tools_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa),
{
/* context changes */
switch (wmn->category) {
+ case NC_GPENCIL:
+ if (wmn->data == ND_DATA)
+ ED_region_tag_redraw(ar);
+ break;
+ case NC_BRUSH:
+ if (wmn->action == NA_EDITED)
+ ED_region_tag_redraw(ar);
+ break;
case NC_SCENE:
switch (wmn->data) {
case ND_MODE:
More information about the Bf-blender-cvs
mailing list