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>2022-04-01 12:05:30 +0300
committerBastien Montagne <bastien@blender.org>2022-04-01 12:05:30 +0300
commitd34c4089f18f4ec6c6f8f79b95146195d065ec1e (patch)
tree55e55bd3166ba23f699f9690853dfd3b1f934eb2
parent9a67f9173b168f1fed88ad1eb59c9e7623c1eca7 (diff)
Fix T96931: Crash on load with library overrides + multiple cloth cache slots.
Not really clear why that would only show with multiple caches... But point cache system is beyond brittle anyway. This fix solves the issue at two different levels: * General safety check in `rna_Cache_info_length` that we do get a valid `pid`. * Forbid usage of this `PointCache.info` RNA property in any diffing/LibOverride processing (since it's by definition runtime, volatile data).
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 8579f188428..ca8c1876887 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -407,7 +407,7 @@ int rna_Cache_info_length(PointerRNA *ptr)
PTCacheID pid = BKE_ptcache_id_find(ob, scene, cache);
- if (cache->flag & PTCACHE_FLAG_INFO_DIRTY) {
+ if (pid.cache != NULL && pid.cache->flag & PTCACHE_FLAG_INFO_DIRTY) {
BKE_ptcache_update_info(&pid);
}
@@ -1016,6 +1016,7 @@ static void rna_def_pointcache_common(StructRNA *srna)
prop = RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "info");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON);
/* Note that we do not actually need a getter here, `rna_Cache_info_length` will update the info
* string just as well. */
RNA_def_property_string_funcs(prop, NULL, "rna_Cache_info_length", NULL);