[Bf-blender-cvs] [a148ec6] alembic_pointcache: Removed the disk/memory toggle for point cache.

Lukas Tönne noreply at git.blender.org
Thu Oct 16 16:53:31 CEST 2014


Commit: a148ec6191e6a63511241886b32de5f9560b9ce0
Author: Lukas Tönne
Date:   Wed Nov 27 13:57:20 2013 +0100
Branches: alembic_pointcache
https://developer.blender.org/rBa148ec6191e6a63511241886b32de5f9560b9ce0

Removed the disk/memory toggle for point cache.

===================================================================

M	release/scripts/startup/bl_ui/properties_physics_common.py
M	source/blender/blenkernel/BKE_pointcache.h
M	source/blender/blenkernel/intern/pointcache.c
M	source/blender/makesrna/intern/rna_pointcache.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index a276218..ad92158 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -135,10 +135,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
                 layout.label(text="Cache is disabled until the file is saved")
                 layout.enabled = False
 
-        if cache.use_disk_cache:
-            layout.prop(cache, "name", text="File Name")
-        else:
-            layout.prop(cache, "name", text="Cache Name")
+        layout.prop(cache, "name", text="File Name")
 
     if not cache.use_external or cachetype == 'SMOKE':
         row = layout.row(align=True)
@@ -156,29 +153,14 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
         can_bake = True
 
         if cachetype not in {'SMOKE', 'DYNAMIC_PAINT', 'RIGID_BODY'}:
-            split = layout.split()
-            split.enabled = enabled and bpy.data.is_saved
-
-            col = split.column()
-            col.prop(cache, "use_disk_cache")
-
-            col = split.column()
-            col.active = cache.use_disk_cache
+            col = layout.column()
+            col.enabled = enabled and bpy.data.is_saved
             col.prop(cache, "use_library_path", "Use Lib Path")
 
             row = layout.row()
             row.enabled = enabled and bpy.data.is_saved
-            row.active = cache.use_disk_cache
             row.label(text="Compression:")
             row.prop(cache, "compression", expand=True)
-
-            layout.separator()
-
-            if cache.id_data.library and not cache.use_disk_cache:
-                can_bake = False
-
-                col = layout.column(align=True)
-                col.label(text="Linked object baking requires Disk Cache to be enabled", icon='INFO')
         else:
             layout.separator()
 
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 6d98dee..5418660 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -323,8 +323,6 @@ void BKE_ptcache_disk_to_mem(struct PTCacheID *pid);
 /* Convert memory cache to disk cache. */
 void BKE_ptcache_mem_to_disk(struct PTCacheID *pid);
 
-/* Convert disk cache to memory cache and vice versa. Clears the cache that was converted. */
-void BKE_ptcache_toggle_disk_cache(struct PTCacheID *pid);
 
 /* Rename all disk cache files with a new name. Doesn't touch the actual content of the files. */
 void BKE_ptcache_disk_cache_rename(struct PTCacheID *pid, const char *name_src, const char *name_dst);
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 8d9b19f..4b441e0 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -3265,38 +3265,6 @@ void BKE_ptcache_mem_to_disk(PTCacheID *pid)
 	if (cache->flag & PTCACHE_BAKED)
 		BKE_ptcache_write(pid, 0);
 }
-void BKE_ptcache_toggle_disk_cache(PTCacheID *pid)
-{
-	PointCache *cache = pid->cache;
-	int last_exact = cache->last_exact;
-
-	if (!G.relbase_valid) {
-		cache->flag &= ~PTCACHE_DISK_CACHE;
-		if (G.debug & G_DEBUG)
-			printf("File must be saved before using disk cache!\n");
-		return;
-	}
-
-	if (cache->cached_frames) {
-		MEM_freeN(cache->cached_frames);
-		cache->cached_frames=NULL;
-	}
-
-	if (cache->flag & PTCACHE_DISK_CACHE)
-		BKE_ptcache_mem_to_disk(pid);
-	else
-		BKE_ptcache_disk_to_mem(pid);
-
-	cache->flag ^= PTCACHE_DISK_CACHE;
-	BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
-	cache->flag ^= PTCACHE_DISK_CACHE;
-	
-	cache->last_exact = last_exact;
-
-	BKE_ptcache_id_time(pid, NULL, 0.0f, NULL, NULL, NULL);
-
-	BKE_ptcache_update_info(pid);
-}
 
 void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const char *name_dst)
 {
diff --git a/source/blender/makesrna/intern/rna_pointcache.c b/source/blender/makesrna/intern/rna_pointcache.c
index 379acf5..55ee7b1 100644
--- a/source/blender/makesrna/intern/rna_pointcache.c
+++ b/source/blender/makesrna/intern/rna_pointcache.c
@@ -83,32 +83,6 @@ static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
 	BLI_freelistN(&pidlist);
 }
 
-static void rna_Cache_toggle_disk_cache(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
-{
-	Object *ob = (Object *)ptr->id.data;
-	PointCache *cache = (PointCache *)ptr->data;
-	PTCacheID *pid = NULL;
-	ListBase pidlist;
-
-	if (!ob)
-		return;
-
-	BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
-
-	for (pid = pidlist.first; pid; pid = pid->next) {
-		if (pid->cache == cache)
-			break;
-	}
-
-	/* smoke can only use disk cache */
-	if (pid && pid->type != PTCACHE_TYPE_SMOKE_DOMAIN)
-		BKE_ptcache_toggle_disk_cache(pid);
-	else
-		cache->flag ^= PTCACHE_DISK_CACHE;
-
-	BLI_freelistN(&pidlist);
-}
-
 static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
 	Object *ob = (Object *)ptr->id.data;
@@ -249,11 +223,6 @@ static void rna_def_pointcache(BlenderRNA *brna)
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_BAKING);
 	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 
-	prop = RNA_def_property(srna, "use_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 (.blend file must be saved first)");
-	RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_toggle_disk_cache");
-
 	prop = RNA_def_property(srna, "is_outdated", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_OUTDATED);
 	RNA_def_property_clear_flag(prop, PROP_EDITABLE);




More information about the Bf-blender-cvs mailing list