diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-25 15:25:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-25 15:25:10 +0400 |
commit | e771e07fe8e876d91922bb3f2c2f04c415ed1a06 (patch) | |
tree | 7ad62b199932428641e4a64a556b9abd58597394 /source/blender/editors | |
parent | a54fc5a99db04afcbbfd661f5fafa1f0fa4c4632 (diff) |
image space now has a mode for view/paint/mask editing.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_edit.c | 9 | ||||
-rw-r--r-- | source/blender/editors/util/undo.c | 4 |
5 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 002c3d48a01..2bfead708be 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1091,7 +1091,7 @@ static int ui_id_brush_get_icon(bContext *C, ID *id) mode = OB_MODE_TEXTURE_PAINT; } else if ((sima = CTX_wm_space_image(C)) && - (sima->flag & SI_DRAWTOOL)) + (sima->mode == SI_MODE_PAINT)) { mode = OB_MODE_TEXTURE_PAINT; } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 073e60ca87c..aa239af43f7 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4667,8 +4667,9 @@ static int image_paint_poll(bContext *C) if (sima) { ARegion *ar = CTX_wm_region(C); - if ((sima->flag & SI_DRAWTOOL) && ar->regiontype == RGN_TYPE_WINDOW) + if ((sima->mode == SI_MODE_PAINT) && ar->regiontype == RGN_TYPE_WINDOW) { return 1; + } } } diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index cf78eaabd88..aaa2676c4c2 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -754,7 +754,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) draw_image_buffer(sima, ar, scene, ima, ibuf, 0.0f, 0.0f, zoomx, zoomy); /* paint helpers */ - if (sima->flag & SI_DRAWTOOL) + if (sima->mode == SI_MODE_PAINT) draw_image_paint_helpers(ar, scene, zoomx, zoomy); diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index 1c488fe4ac7..ae6fe704c6f 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -66,8 +66,11 @@ void ED_space_image_set(SpaceImage *sima, Scene *scene, Object *obedit, Image *i * to check if the face is displayed in UV-localview */ sima->image = ima; - if (ima == NULL || ima->type == IMA_TYPE_R_RESULT || ima->type == IMA_TYPE_COMPOSITE) - sima->flag &= ~SI_DRAWTOOL; + if (ima == NULL || ima->type == IMA_TYPE_R_RESULT || ima->type == IMA_TYPE_COMPOSITE) { + if (sima->mode == SI_MODE_PAINT) { + sima->mode = SI_MODE_VIEW; + } + } if (sima->image) BKE_image_signal(sima->image, &sima->iuser, IMA_SIGNAL_USER_NEW_IMAGE); @@ -257,7 +260,7 @@ int ED_space_image_show_paint(SpaceImage *sima) if (ED_space_image_show_render(sima)) return 0; - return (sima->flag & SI_DRAWTOOL); + return (sima->mode == SI_MODE_PAINT); } int ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit) diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 0c2bfff3b57..65b92168842 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -141,7 +141,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) if (sa && (sa->spacetype == SPACE_IMAGE)) { SpaceImage *sima = (SpaceImage *)sa->spacedata.first; - if ((obact && (obact->mode & OB_MODE_TEXTURE_PAINT)) || (sima->flag & SI_DRAWTOOL)) { + if ((obact && (obact->mode & OB_MODE_TEXTURE_PAINT)) || (sima->mode == SI_MODE_PAINT)) { if (!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname) && undoname) if (U.uiflag & USER_GLOBALUNDO) BKE_undo_name(C, undoname); @@ -238,7 +238,7 @@ int ED_undo_valid(const bContext *C, const char *undoname) if (sa && sa->spacetype == SPACE_IMAGE) { SpaceImage *sima = (SpaceImage *)sa->spacedata.first; - if ((obact && (obact->mode & OB_MODE_TEXTURE_PAINT)) || (sima->flag & SI_DRAWTOOL)) { + if ((obact && (obact->mode & OB_MODE_TEXTURE_PAINT)) || (sima->mode == SI_MODE_PAINT)) { return 1; } } |