Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2004-10-28 16:38:50 +0400
committerTon Roosendaal <ton@blender.org>2004-10-28 16:38:50 +0400
commit3aa1d9432da4e01d30c5bb991800518bad30e9c6 (patch)
treee16da63f813e6ff8792a483300e7003846558774 /source
parente82543da88dc661219bdaba18f140342187e3526 (diff)
Fix for #1666
There's a conflict between global undo and editmode undo. The first one reloads a .blend actually, so pointers change all over. The latter still uses the object pointers for checks. To resolve that the editmode undo system cleans its stack based on object names, not pointers. In previous code I tried something smart to prevent undo stacks being reused when you delete an object, and add new object with same name. That didn't go OK in all cases... so I accept this little quirk for now (rename object still works though, wont clean the undo stack)
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/editmode_undo.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/source/blender/src/editmode_undo.c b/source/blender/src/editmode_undo.c
index 18ec5596de3..4c0150e848b 100644
--- a/source/blender/src/editmode_undo.c
+++ b/source/blender/src/editmode_undo.c
@@ -133,7 +133,7 @@ void undo_editmode_push(char *name, void (*freedata)(void *),
/* prevent two same undocalls */
if(curundo && strcmp("Original", name)==0) {
- if( strcmp(curundo->id.name, G.obedit->id.name)==0 ) {
+ if( curundo->ob==G.obedit ) {
return;
}
}
@@ -184,13 +184,8 @@ static void undo_clean_stack(void)
UndoElem *uel, *next;
int mixed= 0, checknames= 1;
- /* global undo changes pointers, so we also exceptionally allow identical names,
- but not when this object pointer exists in the stack, which happens for
- example when you rename objects and add new one with old name */
- for(uel= undobase.first; uel; uel= uel->next) {
- if( exist_object(uel->ob)) break;
- }
- if(uel) checknames= 0;
+ /* global undo changes pointers, so we also allow identical names */
+ /* side effect: when deleting/renaming object and start editing new one with same name */
uel= undobase.first;
while(uel) {