diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-15 18:21:08 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-15 18:32:38 +0300 |
commit | 13b2ba4fddea0a3b8acab7781e7f0eb8aa0d61a1 (patch) | |
tree | acad199a23868b0567540add14fc18c03c781ea5 /source/blender/blenkernel/intern/anim_sys.c | |
parent | 8c44e182f0805c5a964262de8fd8a4c392bb3c62 (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern/anim_sys.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 38 |
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; + } } } } |