diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-07-23 18:46:31 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-07-23 18:46:31 +0400 |
commit | a62e34057381e8b25b25827ded2e0fd59fc62727 (patch) | |
tree | f0a1de539719688bed8fbc798fc7cbd022f7ab7c /source/blender/editors/util/undo.c | |
parent | f5dd835850d752ccedb9b5b6a5b6ed9b1ffd399f (diff) |
Fix #21028: operator redo creates hundreds of images when texture paint is on.
Now operator redo will look for an undo push with the same name in both the
paint/sculpt and global undo stack.
Diffstat (limited to 'source/blender/editors/util/undo.c')
-rw-r--r-- | source/blender/editors/util/undo.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 636ce9dcec5..1618ef88ba4 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -116,7 +116,9 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) SpaceImage *sima= (SpaceImage *)sa->spacedata.first; if((obact && obact->mode & OB_MODE_TEXTURE_PAINT) || sima->flag & SI_DRAWTOOL) { - ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step); + if(!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname) && undoname) + if(U.uiflag & USER_GLOBALUNDO) + BKE_undo_name(C, undoname); WM_event_add_notifier(C, NC_WINDOW, NULL); return OPERATOR_FINISHED; @@ -139,10 +141,14 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) else { int do_glob_undo= 0; - if(obact && obact->mode & OB_MODE_TEXTURE_PAINT) - ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step); - else if(obact && obact->mode & OB_MODE_SCULPT) - ED_undo_paint_step(C, UNDO_PAINT_MESH, step); + if(obact && obact->mode & OB_MODE_TEXTURE_PAINT) { + if(!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname) && undoname) + do_glob_undo= 1; + } + else if(obact && obact->mode & OB_MODE_SCULPT) { + if(!ED_undo_paint_step(C, UNDO_PAINT_MESH, step, undoname) && undoname) + do_glob_undo= 1; + } else if(obact && obact->mode & OB_MODE_PARTICLE_EDIT) { if(step==1) PE_undo(CTX_data_scene(C)); |