diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_node/node_header.c | 14 | ||||
-rw-r--r-- | source/blender/editors/util/undo.c | 3 |
2 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index f461174d74f..e17961b6c7c 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -41,6 +41,7 @@ #include "BLF_translation.h" +#include "BKE_blender.h" #include "BKE_context.h" #include "BKE_global.h" #include "BKE_main.h" @@ -64,7 +65,7 @@ static void do_node_add(bContext *C, bNodeTemplate *ntemp) SpaceNode *snode = CTX_wm_space_node(C); ScrArea *sa = CTX_wm_area(C); ARegion *ar; - bNode *node; + bNode *node, *node_new; /* get location to add node at mouse */ for (ar = sa->regionbase.first; ar; ar = ar->next) { @@ -84,7 +85,7 @@ static void do_node_add(bContext *C, bNodeTemplate *ntemp) else node->flag &= ~NODE_TEST; } - /* node= */ node_add_node(snode, bmain, scene, ntemp, snode->cursor[0], snode->cursor[1]); + node_new = node_add_node(snode, bmain, scene, ntemp, snode->cursor[0], snode->cursor[1]); /* select previous selection before autoconnect */ for (node = snode->edittree->nodes.first; node; node = node->next) { @@ -95,7 +96,14 @@ static void do_node_add(bContext *C, bNodeTemplate *ntemp) for (node = snode->edittree->nodes.first; node; node = node->next) { if (node->flag & NODE_TEST) node->flag &= ~NODE_SELECT; } - + + /* once this is called from an operator, this should be removed */ + if (node_new) { + char undostr[BKE_UNDO_STR_MAX]; + BLI_snprintf(undostr, sizeof(BKE_UNDO_STR_MAX), "Add Node %s", nodeLabel(node_new)); + BKE_write_undo(C, undostr); + } + snode_notify(C, snode); snode_dag_update(C, snode); } diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 2ffad3ad796..5eafc3e65a9 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -107,8 +107,7 @@ void ED_undo_push(bContext *C, const char *str) PE_undo_push(CTX_data_scene(C), str); } else { - if (U.uiflag & USER_GLOBALUNDO) - BKE_write_undo(C, str); + BKE_write_undo(C, str); } if (wm->file_saved) { |