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>2021-01-22 16:52:50 +0300
committerBastien Montagne <bastien@blender.org>2021-01-22 17:31:15 +0300
commitbe7106a974646483f4b087539c62603fe53560cf (patch)
treee980cf77d9698b934111ccd52d27571c043d8214 /source/blender/makesrna/intern/rna_access_compare_override.c
parent7e32bb849265bde7dc58fdf698fd876af6b1dfd6 (diff)
LibOverride: Add an 'post apply' callback to IDTypeInfo.
Currently this is needed to properly tag PointCache's for info update (fixes an issue reported in T82503). Suspect we may need this in more cases in the future though, RNA assign/update processes are not always 100% enough to deal with complicated corner cases.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access_compare_override.c')
-rw-r--r--source/blender/makesrna/intern/rna_access_compare_override.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c
index 1e7f5e841ba..2d6f1bbc059 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -42,6 +42,7 @@
#include "BKE_armature.h"
#include "BKE_idprop.h"
+#include "BKE_idtype.h"
#include "BKE_lib_override.h"
#include "BKE_main.h"
@@ -1178,6 +1179,17 @@ void RNA_struct_override_apply(Main *bmain,
#endif
}
}
+
+ /* Some cases (like point caches) may require additional post-processing. */
+ if (RNA_struct_is_a(ptr_dst->type, &RNA_ID)) {
+ ID *id_dst = ptr_dst->data;
+ ID *id_src = ptr_src->data;
+ const IDTypeInfo *id_type = BKE_idtype_get_info_from_id(id_dst);
+ if (id_type->lib_override_apply_post != NULL) {
+ id_type->lib_override_apply_post(id_dst, id_src);
+ }
+ }
+
#ifdef DEBUG_OVERRIDE_TIMEIT
TIMEIT_END_AVERAGED(RNA_struct_override_apply);
#endif