diff options
-rw-r--r-- | source/blender/blenkernel/BKE_paint.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 24 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 13 |
8 files changed, 35 insertions, 17 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 419fb4cedae..e517d950d05 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -51,7 +51,7 @@ extern const char PAINT_CURSOR_VERTEX_PAINT[3]; extern const char PAINT_CURSOR_WEIGHT_PAINT[3]; extern const char PAINT_CURSOR_TEXTURE_PAINT[3]; -void paint_init(struct Paint *p, const char col[3]); +void BKE_paint_init(struct Paint *p, const char col[3]); void free_paint(struct Paint *p); void copy_paint(struct Paint *src, struct Paint *tar); diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index ef3fd5c93d0..56db84ab0d5 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -168,7 +168,7 @@ int paint_vertsel_test(Object *ob) ); } -void paint_init(Paint *p, const char col[3]) +void BKE_paint_init(Paint *p, const char col[3]) { Brush *brush; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index aa239af43f7..91a41224d6a 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5312,7 +5312,7 @@ void ED_space_image_uv_sculpt_update(wmWindowManager *wm, ToolSettings *settings settings->uv_relax_method = UV_SCULPT_TOOL_RELAX_LAPLACIAN; } - paint_init(&settings->uvsculpt->paint, PAINT_CURSOR_SCULPT); + BKE_paint_init(&settings->uvsculpt->paint, PAINT_CURSOR_SCULPT); WM_paint_cursor_activate(wm, uv_sculpt_brush_poll, brush_drawcursor, NULL); @@ -5602,7 +5602,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op) me->mtface = CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT, NULL, me->totface); - paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT); + BKE_paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT); if (U.glreslimit != 0) GPU_free_images(); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 1b62ba8a7e0..3c389f97b34 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1997,7 +1997,7 @@ static int set_wpaint(bContext *C, wmOperator *UNUSED(op)) /* toggle */ if (wp == NULL) wp = scene->toolsettings->wpaint = new_vpaint(1); - paint_init(&wp->paint, PAINT_CURSOR_WEIGHT_PAINT); + BKE_paint_init(&wp->paint, PAINT_CURSOR_WEIGHT_PAINT); paint_cursor_start(C, weight_paint_poll); mesh_octree_table(ob, NULL, NULL, 's'); @@ -2574,7 +2574,7 @@ static int set_vpaint(bContext *C, wmOperator *op) /* toggle */ paint_cursor_start(C, vertex_paint_poll); - paint_init(&vp->paint, PAINT_CURSOR_VERTEX_PAINT); + BKE_paint_init(&vp->paint, PAINT_CURSOR_VERTEX_PAINT); } if (me) diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 35d508c5a1f..4932a41579e 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -4212,7 +4212,7 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *UNUSED(op)) /* Mask layer is required */ ED_sculpt_mask_layers_ensure(ob, mmd); - paint_init(&ts->sculpt->paint, PAINT_CURSOR_SCULPT); + BKE_paint_init(&ts->sculpt->paint, PAINT_CURSOR_SCULPT); paint_cursor_start(C, sculpt_poll); } diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 9b1ffcf31b1..d3fb0157828 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -389,7 +389,6 @@ static void clip_listener(ScrArea *sa, wmNotifier *wmn) } switch (wmn->action) { case NA_SELECTED: - clip_scopes_tag_refresh(sa); ED_area_tag_redraw(sa); break; case NA_EDITED: diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 178eba3cb68..349d4f5d53f 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -429,6 +429,23 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn) ED_area_tag_redraw(sa); } break; + case NC_MASK: + switch (wmn->data) { + case ND_SELECT: + case ND_DATA: + case ND_DRAW: + ED_area_tag_redraw(sa); + break; + } + switch (wmn->action) { + case NA_SELECTED: + ED_area_tag_redraw(sa); + break; + case NA_EDITED: + ED_area_tag_redraw(sa); + break; + } + break; case NC_GEOM: switch (wmn->data) { case ND_DATA: @@ -468,8 +485,7 @@ static int image_context(const bContext *C, const char *member, bContextDataResu return 1; } else if (CTX_data_equals(member, "edit_mask")) { - Scene *scene = CTX_data_scene(C); - Mask *mask = BKE_sequencer_mask_get(scene); /* XXX */ + Mask *mask = ED_space_image_get_mask(sima); if (mask) { CTX_data_id_pointer_set(result, &mask->id); } @@ -605,12 +621,12 @@ static void image_main_area_draw(const bContext *C, ARegion *ar) draw_image_grease_pencil((bContext *)C, 0); { - Mask *mask = BKE_sequencer_mask_get(scene); /* XXX */ + Mask *mask = ED_space_image_get_mask(sima); if (mask) { int width, height; ED_mask_size(C, &width, &height); ED_mask_draw_region(mask, ar, - 0, 0, /* TODO */ + sima->mask_info.draw_flag, sima->mask_info.draw_type, width, height, TRUE, FALSE, NULL, C); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index c710831d421..acfd413fdde 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -123,7 +123,7 @@ EnumPropertyItem clip_editor_mode_items[] = { {SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", ICON_SNAP_FACE, "Reconstruction", "Show tracking/reconstruction tools"}, {SC_MODE_DISTORTION, "DISTORTION", ICON_GRID, "Distortion", "Show distortion tools"}, - {SC_MODE_MASKEDIT, "MASKEDIT", ICON_MOD_MASK, "Mask editing", "Show mask editing tools"}, + {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask editing", "Show mask editing tools"}, {0, NULL, 0, NULL, NULL} }; @@ -529,11 +529,14 @@ static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data); } -static void rna_SpaceImageEditor_paint_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) +static void rna_SpaceImageEditor_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT); + SpaceImage *sima = (SpaceImage *)(ptr->data); + if (sima->mode == SI_MODE_PAINT) { + BKE_paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT); - ED_space_image_paint_update(bmain->wm.first, scene->toolsettings); + ED_space_image_paint_update(bmain->wm.first, scene->toolsettings); + } } static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr) @@ -2041,7 +2044,7 @@ static void rna_def_space_image(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, image_space_mode_items); RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceImageEditor_mode_update"); /* grease pencil */ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); |