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 13:21:00 +0300
committerBastien Montagne <bastien@blender.org>2022-04-01 13:35:25 +0300
commit1264142f78302dcecd229b3dd72544470e553964 (patch)
tree418b7bbf1f83c17b64eb524a7cef8ea6159de894 /source/blender/makesrna/intern/rna_animation.c
parentd34c4089f18f4ec6c6f8f79b95146195d065ec1e (diff)
LibOverride: RNA Apply: let apply function responsible for calling update or not on overridden properties.
While this is the desired behavior in almost cases, there are a few hairy nightmares that may require not to do so. NOTE: this change should should not modify any current behavior at all.
Diffstat (limited to 'source/blender/makesrna/intern/rna_animation.c')
-rw-r--r--source/blender/makesrna/intern/rna_animation.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index ba7f3c55460..4f07cb235fa 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -680,7 +680,7 @@ static FCurve *rna_Driver_find(AnimData *adt,
return BKE_fcurve_find(&adt->drivers, data_path, index);
}
-bool rna_AnimaData_override_apply(Main *UNUSED(bmain),
+bool rna_AnimaData_override_apply(Main *bmain,
PointerRNA *ptr_dst,
PointerRNA *ptr_src,
PointerRNA *ptr_storage,
@@ -707,11 +707,13 @@ bool rna_AnimaData_override_apply(Main *UNUSED(bmain),
if (adt_dst == NULL && adt_src != NULL) {
/* Copy anim data from reference into final local ID. */
BKE_animdata_copy_id(NULL, ptr_dst->owner_id, ptr_src->owner_id, 0);
+ RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
return true;
}
else if (adt_dst != NULL && adt_src == NULL) {
/* Override has cleared/removed anim data from its reference. */
BKE_animdata_free(ptr_dst->owner_id, true);
+ RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
return true;
}
@@ -722,7 +724,7 @@ bool rna_NLA_tracks_override_apply(Main *bmain,
PointerRNA *ptr_dst,
PointerRNA *ptr_src,
PointerRNA *UNUSED(ptr_storage),
- PropertyRNA *UNUSED(prop_dst),
+ PropertyRNA *prop_dst,
PropertyRNA *UNUSED(prop_src),
PropertyRNA *UNUSED(prop_storage),
const int UNUSED(len_dst),
@@ -771,6 +773,8 @@ bool rna_NLA_tracks_override_apply(Main *bmain,
BLI_insertlinkafter(&anim_data_dst->nla_tracks, nla_track_anchor, nla_track_dst);
// printf("%s: We inserted a NLA Track...\n", __func__);
+
+ RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
return true;
}