Bugfix #25457
authorTon Roosendaal <ton@blender.org>
Mon, 3 Jan 2011 12:48:16 +0000 (12:48 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 3 Jan 2011 12:48:16 +0000 (12:48 +0000)
After loading file, the Undo-push happened too early, causing an
undo for the first action to show animated setups wrong.

(material.c: removed old crap)

source/blender/blenkernel/intern/material.c
source/blender/windowmanager/intern/wm_files.c

index dae00636370f69fd3b5676f9330465c0e9a4094e..3f18e7f372397bd6baa37b88983cf741fa8f1348 100644 (file)
@@ -1341,7 +1341,6 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col)
 
 /* copy/paste buffer, if we had a propper py api that would be better */
 Material matcopybuf;
-// MTex mtexcopybuf;
 static short matcopied=0;
 
 void clear_matcopybuf(void)
@@ -1352,7 +1351,6 @@ void clear_matcopybuf(void)
 
 void free_matcopybuf(void)
 {
-//     extern MTex mtexcopybuf;        /* buttons.c */
        int a;
 
        for(a=0; a<MAX_MTEX; a++) {
@@ -1373,7 +1371,6 @@ void free_matcopybuf(void)
                MEM_freeN(matcopybuf.nodetree);
                matcopybuf.nodetree= NULL;
        }
-//     default_mtex(&mtexcopybuf);
 
        matcopied= 0;
 }
@@ -1442,10 +1439,4 @@ void paste_matcopybuf(Material *ma)
        }
 
        ma->nodetree= ntreeCopyTree(matcopybuf.nodetree, 0);
-
-       /*
-       BIF_preview_changed(ID_MA);
-       BIF_undo_push("Paste material settings");
-       scrarea_queue_winredraw(curarea);
-       */
 }
index 5938f661ca80cff223d140292531d885e053a445..5403699a0b347cad749b2f788e98e7e1eb19ae4d 100644 (file)
@@ -305,9 +305,6 @@ void WM_read_file(bContext *C, const char *name, ReportList *reports)
                                write_history();
                }
 
-// XXX         undo_editmode_clear();
-               BKE_reset_undo();
-               BKE_write_undo(C, "original");  /* save current state */
 
                WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL);
 //             refresh_interface_font();
@@ -323,6 +320,11 @@ void WM_read_file(bContext *C, const char *name, ReportList *reports)
                BPY_load_user_modules(C);
 #endif
                CTX_wm_window_set(C, NULL); /* exits queues */
+
+               // XXX          undo_editmode_clear();
+               BKE_reset_undo();
+               BKE_write_undo(C, "original");  /* save current state */
+               
        }
        else if(retval==1)
                BKE_write_undo(C, "Import file");