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:
authorBastien Montagne <bastien@blender.org>2020-11-16 14:29:21 +0300
committerBastien Montagne <bastien@blender.org>2020-11-16 16:39:31 +0300
commit13bcb000fa81effa3c8302b2faba853c93a6c573 (patch)
treea6f428a5d7ef44482be2337eaeb5642fdb9b3be8 /source/blender/blenkernel/intern/object.c
parent97d52daf960f914e771c9732d13ee122fc6d13e7 (diff)
Fix broken pointcache on disk in some cases.
Root of the issue is that point caches are added to the object's list on-demand, which often ends up with them being added only during depsgraph evaluation, i.e. on COW objects. This could result in having 'orig' data caches with invalid/unset stack index at some points (e.g. when reading a file and applying liboverrides), leading to discarding valid existing disk cache files. Fact that one of those index is signed, and the other not, does not help... While this is very weak, fixing broken PointCache code is out of the scope of a bug fix, so this patch merely: * Simplifies and factorizes the code generating the 'extension' part of caches filenames; * Ensures `BKE_object_insert_ptcache` is called when needed so that we always have a valid stack index to generate that filename extension. This is only a bandaid, but it is simple and should be safe enough for now. Related to T82503.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 5b0b1f333f4..5f8406e7d37 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -4311,6 +4311,10 @@ static int pc_cmp(const void *a, const void *b)
return 0;
}
+/* TODO: Review the usages of this function, currently with COW it will be called for orig object
+ * and then again for COW copies of it, think this is bad since there is no guarantee that we get
+ * the same stack index in both cases? Order is important since this index is used for filenames on
+ * disk. */
int BKE_object_insert_ptcache(Object *ob)
{
LinkData *link = NULL;