Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h5
-rw-r--r--source/blender/blenkernel/intern/pointcache.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 7456a4bfb15..f13f84e4eb2 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -293,6 +293,11 @@ PTCacheID BKE_ptcache_id_find(struct Object *ob, struct Scene *scene, struct Poi
void BKE_ptcache_ids_from_object(
struct ListBase *lb, struct Object *ob, struct Scene *scene, int duplis);
+/****************** Query funcs ****************************/
+
+/* Check whether object has a point cache. */
+bool BKE_ptcache_object_has(struct Scene *scene, struct Object *ob, int duplis);
+
/***************** Global funcs ****************************/
void BKE_ptcache_remove(void);
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 60defc575f4..0dc192db8f0 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1829,6 +1829,18 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
scene, ob, duplis, ptcache_ids_from_object_cb, &data);
}
+static bool ptcache_object_has_cb(PTCacheID *UNUSED(pid),
+ void *UNUSED(userdata))
+{
+ return false;
+}
+
+bool BKE_ptcache_object_has(struct Scene *scene, struct Object *ob, int duplis)
+{
+ return !foreach_object_ptcache(
+ scene, ob, duplis, ptcache_object_has_cb, NULL);
+}
+
/* File handling */
static const char *ptcache_file_extension(const PTCacheID *pid)