diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_blender_undo.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender_undo.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_blender_undo.h b/source/blender/blenkernel/BKE_blender_undo.h index 9547eeb9838..84a6d07be7d 100644 --- a/source/blender/blenkernel/BKE_blender_undo.h +++ b/source/blender/blenkernel/BKE_blender_undo.h @@ -42,6 +42,7 @@ extern bool BKE_undo_is_valid(const char *name); extern void BKE_undo_reset(void); extern void BKE_undo_number(struct bContext *C, int nr); extern const char *BKE_undo_get_name(int nr, bool *r_active); +extern const char *BKE_undo_get_name_last(void); extern bool BKE_undo_save_file(const char *filename); extern struct Main *BKE_undo_get_main(struct Scene **r_scene); diff --git a/source/blender/blenkernel/intern/blender_undo.c b/source/blender/blenkernel/intern/blender_undo.c index d64bf7ecf43..ce6d29bbfee 100644 --- a/source/blender/blenkernel/intern/blender_undo.c +++ b/source/blender/blenkernel/intern/blender_undo.c @@ -319,6 +319,13 @@ const char *BKE_undo_get_name(int nr, bool *r_active) return NULL; } +/* return the name of the last item */ +const char *BKE_undo_get_name_last() +{ + UndoElem *uel = undobase.last; + return (uel ? uel->name : NULL); +} + /** * Saves .blend using undo buffer. * |