[Bf-blender-cvs] [d34c4089f18] master: Fix T96931: Crash on load with library overrides + multiple cloth cache slots.

Bastien Montagne noreply at git.blender.org
Fri Apr 1 11:09:10 CEST 2022


Commit: d34c4089f18f4ec6c6f8f79b95146195d065ec1e
Author: Bastien Montagne
Date:   Fri Apr 1 11:05:30 2022 +0200
Branches: master
https://developer.blender.org/rBd34c4089f18f4ec6c6f8f79b95146195d065ec1e

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).

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

M	source/blender/makesrna/intern/rna_object_force.c

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

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);



More information about the Bf-blender-cvs mailing list