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:
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 4eeabd7a4da..a14231fd427 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1710,6 +1710,8 @@ static void animsys_evaluate_fcurves(PointerRNA *ptr, ListBase *list, AnimMapper
orig_ptr.id.data = ((ID *)orig_ptr.id.data)->orig_id;
orig_ptr.data = orig_ptr.id.data;
+ const bool copy_on_write = orig_ptr.id.data != NULL;
+
/* calculate then execute each curve */
for (fcu = list->first; fcu; fcu = fcu->next) {
/* check if this F-Curve doesn't belong to a muted group */
@@ -1719,26 +1721,36 @@ static void animsys_evaluate_fcurves(PointerRNA *ptr, ListBase *list, AnimMapper
PathResolvedRNA anim_rna;
/* Read current value from original datablock. */
float dna_val;
- if (animsys_store_rna_setting(&orig_ptr, remap, fcu->rna_path, fcu->array_index, &anim_rna)) {
- if (!animsys_read_rna_setting(&anim_rna, &dna_val)) {
+
+ if (copy_on_write) {
+ if (animsys_store_rna_setting(&orig_ptr, remap, fcu->rna_path, fcu->array_index, &anim_rna)) {
+ if (!animsys_read_rna_setting(&anim_rna, &dna_val)) {
+ continue;
+ }
+ }
+ else {
continue;
}
}
- else {
- continue;
- }
+
if (animsys_store_rna_setting(ptr, remap, fcu->rna_path, fcu->array_index, &anim_rna)) {
- const bool check_orig_dna = ((recalc & ADT_RECALC_CHECK_ORIG_DNA) != 0);
- /* If we are tweaking DNA without changing frame, we don't write f-curves,
- * since otherwise we will not be able to change properties which has animation.
- */
- if (check_orig_dna && fcu->orig_dna_val != dna_val) {
- continue;
+ if (copy_on_write) {
+ const bool check_orig_dna = ((recalc & ADT_RECALC_CHECK_ORIG_DNA) != 0);
+ /* If we are tweaking DNA without changing frame, we don't write f-curves,
+ * since otherwise we will not be able to change properties which has animation.
+ */
+ if (check_orig_dna && fcu->orig_dna_val != dna_val) {
+ continue;
+ }
}
+
const float curval = calculate_fcurve(&anim_rna, fcu, ctime);
animsys_write_rna_setting(&anim_rna, curval);
- /* Store original DNA value f-curve was written for. */
- fcu->orig_dna_val = dna_val;
+
+ if (copy_on_write) {
+ /* Store original DNA value f-curve was written for. */
+ fcu->orig_dna_val = dna_val;
+ }
}
}
}