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.
This commit is contained in:
Brecht Van Lommel 2018-05-15 17:21:08 +02:00
parent 8c44e182f0
commit 13b2ba4fdd
1 changed files with 25 additions and 13 deletions

View File

@ -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;
}
}
}
}