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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user