[Bf-blender-cvs] [c9e9a422154] master: Fix T89771: Cloth disk cache is not read on library overrides in some cases.

Bastien Montagne noreply at git.blender.org
Wed Jul 14 14:48:01 CEST 2021


Commit: c9e9a422154581c5882b74e93c5be25798c88026
Author: Bastien Montagne
Date:   Wed Jul 14 12:14:51 2021 +0200
Branches: master
https://developer.blender.org/rBc9e9a422154581c5882b74e93c5be25798c88026

Fix T89771: Cloth disk cache is not read on library overrides in some cases.

Issue would happen when the original, linked data already had 'Disk Cache'
setting enabled. Override would then see no difference with linked data,
and not create any rule for it (as expected).

Root of the issue was that in Cloth modifier copy code, those disk cache
settings were not copied at all, so every time local overrides were
re-generated by copying linked data, those flags would be reset to their
default values.

NOTE: this might exist in other PointCache usages as well, but this code is
in such a bad state that I'd rather do minimal strictly needed changes
there, on a case-by-case basis. Proper recode of that whole system is
wayyyyy out of scope here.

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

M	source/blender/makesdna/DNA_pointcache_types.h
M	source/blender/modifiers/intern/MOD_cloth.c

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

diff --git a/source/blender/makesdna/DNA_pointcache_types.h b/source/blender/makesdna/DNA_pointcache_types.h
index 5ba76b456f0..7de0bb29c46 100644
--- a/source/blender/makesdna/DNA_pointcache_types.h
+++ b/source/blender/makesdna/DNA_pointcache_types.h
@@ -157,6 +157,7 @@ enum {
   PTCACHE_FLAG_INFO_DIRTY = 1 << 14,
 
   PTCACHE_REDO_NEEDED = PTCACHE_OUTDATED | PTCACHE_FRAMES_SKIPPED,
+  PTCACHE_FLAGS_COPY = PTCACHE_DISK_CACHE | PTCACHE_EXTERNAL | PTCACHE_IGNORE_LIBPATH,
 };
 
 #define PTCACHE_COMPRESS_NO 0
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c
index 40d027f3044..4487adcfdda 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -206,6 +206,7 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla
       tclmd->point_cache->step = clmd->point_cache->step;
       tclmd->point_cache->startframe = clmd->point_cache->startframe;
       tclmd->point_cache->endframe = clmd->point_cache->endframe;
+      tclmd->point_cache->flag |= (clmd->point_cache->flag & PTCACHE_FLAGS_COPY);
     }
   }



More information about the Bf-blender-cvs mailing list