Auto pack: don't show "No new files have been packed" on every .blend file save.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 1 May 2015 14:03:45 +0000 (16:03 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 1 May 2015 17:20:42 +0000 (19:20 +0200)
source/blender/blenkernel/BKE_packedFile.h
source/blender/blenkernel/intern/packedFile.c
source/blender/editors/space_info/info_ops.c
source/blender/windowmanager/intern/wm_files.c

index 8fab44121de16b7c5a33bd1efecd1ab056a807cf..a2397922061865ec0591b4dcdf73bba9be200ee5 100644 (file)
@@ -48,7 +48,7 @@ struct PackedFile *dupPackedFile(const struct PackedFile *pf_src);
 struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename, const char *relabase);
 struct PackedFile *newPackedFileMemory(void *mem, int memlen);
 
-void packAll(struct Main *bmain, struct ReportList *reports);
+void packAll(struct Main *bmain, struct ReportList *reports, bool verbose);
 void packLibraries(struct Main *bmain, struct ReportList *reports);
 
 /* unpack */
index 61e39d0ad473e978c3d8cb8ce791a188a76e9c0b..6821252161778c80a3b5e88b8a4847b7dd3a3c4c 100644 (file)
@@ -224,7 +224,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename, const char
 }
 
 /* no libraries for now */
-void packAll(Main *bmain, ReportList *reports)
+void packAll(Main *bmain, ReportList *reports, bool verbose)
 {
        Image *ima;
        VFont *vfont;
@@ -237,7 +237,7 @@ void packAll(Main *bmain, ReportList *reports)
                                BKE_image_packfiles(reports, ima, ID_BLEND_PATH(bmain, &ima->id));
                                tot ++;
                        }
-                       else if (BKE_image_is_animated(ima)) {
+                       else if (BKE_image_is_animated(ima) && verbose) {
                                BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported",
                                            ima->id.name + 2);
                        }
@@ -258,10 +258,10 @@ void packAll(Main *bmain, ReportList *reports)
                }
        }
        
-       if (tot == 0)
-               BKE_report(reports, RPT_INFO, "No new files have been packed");
-       else
+       if (tot > 0)
                BKE_reportf(reports, RPT_INFO, "Packed %d files", tot);
+       else if (verbose)
+               BKE_report(reports, RPT_INFO, "No new files have been packed");
 
 
 }
index 240d8baa6f24d9afeecdf9bdc586bb5bd153e49c..a1f90f16bbf4c94f86377dc1344ff7dadada06ee 100644 (file)
@@ -134,7 +134,7 @@ static int autopack_toggle_exec(bContext *C, wmOperator *op)
                G.fileflags &= ~G_AUTOPACK;             
        }
        else {
-               packAll(bmain, op->reports);
+               packAll(bmain, op->reports, true);
                G.fileflags |= G_AUTOPACK;
        }
        
@@ -161,7 +161,7 @@ static int pack_all_exec(bContext *C, wmOperator *op)
 {
        Main *bmain = CTX_data_main(C);
        
-       packAll(bmain, op->reports);
+       packAll(bmain, op->reports, true);
        G.fileflags |= G_AUTOPACK;
        
        return OPERATOR_FINISHED;
index df0d27bc43e016a140eef74887b9b92154ac220f..a3cbb2b6eec41cc85697ebc7b2f99eca4a1940b2 100644 (file)
@@ -951,7 +951,7 @@ int wm_file_write(bContext *C, const char *filepath, int fileflags, ReportList *
        /* operator now handles overwrite checks */
 
        if (G.fileflags & G_AUTOPACK) {
-               packAll(G.main, reports);
+               packAll(G.main, reports, false);
        }
 
        /* don't forget not to return without! */