diff options
author | Matt Ebb <matt@mke3.net> | 2010-05-03 07:02:27 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-05-03 07:02:27 +0400 |
commit | 23ccac18cdf285bce72c60bd15cd6b0249954379 (patch) | |
tree | 748b4df9a7937c39a7bd94d8fa85e0e833e5b18f /source/blender | |
parent | 43f0fd08b3bfd61df5f18f942502ee42dae2254f (diff) |
Fix [#22199] Cloth Cache Panel > Disk Cache doesn't work
Condition for this to work (.blend file must be saved) was poorly communicated
in the UI (printfs are no good for this - ideally should use reports). Tweaked this a bit.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_main.c | 9 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 2 |
3 files changed, 18 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 3d02f175174..25f8dc9bd56 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2652,7 +2652,8 @@ void BKE_ptcache_mem_to_disk(PTCacheID *pid) ptcache_file_init_pointers(pf); if(!ptcache_file_write_header_begin(pf) || !pid->write_header(pf)) { - printf("Error writing to disk cache\n"); + if (G.f & G_DEBUG) + printf("Error writing to disk cache\n"); cache->flag &= ~PTCACHE_DISK_CACHE; ptcache_file_close(pf); @@ -2662,7 +2663,8 @@ void BKE_ptcache_mem_to_disk(PTCacheID *pid) for(i=0; i<pm->totpoint; i++) { ptcache_copy_data(pm->cur, pf->cur); if(!ptcache_file_write_data(pf)) { - printf("Error writing to disk cache\n"); + if (G.f & G_DEBUG) + printf("Error writing to disk cache\n"); cache->flag &= ~PTCACHE_DISK_CACHE; ptcache_file_close(pf); @@ -2678,7 +2680,8 @@ void BKE_ptcache_mem_to_disk(PTCacheID *pid) BKE_ptcache_write_cache(pid, 0); } else - printf("Error creating disk cache file\n"); + if (G.f & G_DEBUG) + printf("Error creating disk cache file\n"); } } void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) @@ -2688,7 +2691,8 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) if (!G.relbase_valid){ cache->flag &= ~PTCACHE_DISK_CACHE; - printf("File must be saved before using disk cache!\n"); + if (G.f & G_DEBUG) + printf("File must be saved before using disk cache!\n"); return; } diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 7a680e00c8b..7688d92f2e1 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -50,6 +50,10 @@ static void rna_Main_debug_set(PointerRNA *ptr, const int value) G.f &= ~G_DEBUG; } +static int rna_Main_fileissaved_get(PointerRNA *ptr) +{ + return G.relbase_valid; +} static void rna_Main_filename_get(PointerRNA *ptr, char *value) { @@ -308,6 +312,11 @@ void RNA_def_main(BlenderRNA *brna) RNA_def_property_string_funcs(prop, "rna_Main_filename_get", "rna_Main_filename_length", "rna_Main_filename_set"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file"); + + prop= RNA_def_property(srna, "file_is_saved", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, "rna_Main_fileissaved_get", NULL); + RNA_def_property_ui_text(prop, "File is Saved", "Has the current session been saved to disk as a .blend file"); prop= RNA_def_property(srna, "debug", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_Main_debug_get", "rna_Main_debug_set"); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index ee5450551a8..dcc9934721d 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -709,7 +709,7 @@ static void rna_def_pointcache(BlenderRNA *brna) prop= RNA_def_property(srna, "disk_cache", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_DISK_CACHE); - RNA_def_property_ui_text(prop, "Disk Cache", "Save cache files to disk"); + RNA_def_property_ui_text(prop, "Disk Cache", "Save cache files to disk (.blend file must be saved first)"); RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_toggle_disk_cache"); prop= RNA_def_property(srna, "outdated", PROP_BOOLEAN, PROP_NONE); |