[Bf-blender-cvs] [13b2ba4fdde] blender2.8: Fix Cycles motion blur not working with CoW disabled.
Brecht Van Lommel
noreply at git.blender.org
Tue May 15 17:34:09 CEST 2018
Commit: 13b2ba4fddea0a3b8acab7781e7f0eb8aa0d61a1
Author: Brecht Van Lommel
Date: Tue May 15 17:21:08 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB13b2ba4fddea0a3b8acab7781e7f0eb8aa0d61a1
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.
===================================================================
M 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;
+ }
}
}
}
More information about the Bf-blender-cvs
mailing list