[Bf-blender-cvs] [512a560cde1] master: Cleanup: remove BKE_ptcache_remove
Campbell Barton
noreply at git.blender.org
Tue Dec 7 08:47:45 CET 2021
Commit: 512a560cde10231494e0df3dbc5ade361c7d976b
Author: Campbell Barton
Date: Tue Dec 7 18:47:01 2021 +1100
Branches: master
https://developer.blender.org/rB512a560cde10231494e0df3dbc5ade361c7d976b
Cleanup: remove BKE_ptcache_remove
No longer needed as the temporary directory is cleared on exit.
===================================================================
M source/blender/blenkernel/BKE_pointcache.h
M source/blender/blenkernel/intern/pointcache.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index abd3f09fbb4..47d3d83f8bb 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -308,12 +308,6 @@ void BKE_ptcache_ids_from_object(struct ListBase *lb,
*/
bool BKE_ptcache_object_has(struct Scene *scene, struct Object *ob, int duplis);
-/***************** Global funcs ****************************/
-/**
- * Use this when quitting Blender, with unsaved files.
- */
-void BKE_ptcache_remove(void);
-
/************ ID specific functions ************************/
void BKE_ptcache_id_clear(PTCacheID *id, int mode, unsigned int cfra);
bool BKE_ptcache_id_exist(PTCacheID *id, int cfra);
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 91b78680595..30985eb7df9 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -3008,49 +3008,6 @@ int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode)
return reset;
}
-void BKE_ptcache_remove(void)
-{
- char path[MAX_PTCACHE_PATH];
- char path_full[MAX_PTCACHE_PATH];
- int rmdir = 1;
-
- ptcache_path(NULL, path);
-
- if (BLI_exists(path)) {
- /* The pointcache dir exists? - remove all pointcache */
-
- DIR *dir;
- struct dirent *de;
-
- dir = opendir(path);
- if (dir == NULL) {
- return;
- }
-
- while ((de = readdir(dir)) != NULL) {
- if (FILENAME_IS_CURRPAR(de->d_name)) {
- /* do nothing */
- }
- else if (strstr(de->d_name, PTCACHE_EXT)) { /* Do we have the right extension? */
- BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
- BLI_delete(path_full, false, false);
- }
- else {
- rmdir = 0; /* unknown file, don't remove the dir */
- }
- }
-
- closedir(dir);
- }
- else {
- rmdir = 0; /* Path doesn't exist. */
- }
-
- if (rmdir) {
- BLI_delete(path, true, false);
- }
-}
-
/* Point Cache handling */
PointCache *BKE_ptcache_add(ListBase *ptcaches)
More information about the Bf-blender-cvs
mailing list