From 13b2ba4fddea0a3b8acab7781e7f0eb8aa0d61a1 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 15 May 2018 17:21:08 +0200 Subject: Fix Cycles motion blur not working with CoW disabled. Not so important but convenient for testing, and makes the Cycles tests pass again for now. --- source/blender/blenkernel/intern/anim_sys.c | 38 +++++++++++++++++++---------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'source/blender/blenkernel/intern/anim_sys.c') 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; + } } } } -- cgit v1.2.3