diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-09-25 11:31:34 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-09-25 11:32:14 +0300 |
commit | fbfa904bce9b852a2bc3efaac339f34362e16944 (patch) | |
tree | aacacbb24115d910364e9b1acb27b867f05585c0 /source/blender/blenkernel | |
parent | d0279f7d36a6cba8bf91b9c6a982da5185a51ac4 (diff) |
Fix T69573: Driver Value does not slide along the actual value in the Driver Editor
This change is two-fold:
- Ensure the result of the F-Curve evaluation is stored on the FCurve
object. This was done in 2.79 but lost when we moved to more granular
per-curve evaluation from the depsgraph.
- Flush this result from the CoW copy back to the original.
Reviewed by: sergey
Differential Revision: https://developer.blender.org/D5888
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_animsys.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index a2a14011595..7ef99fe1405 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -289,7 +289,7 @@ void BKE_animsys_eval_animdata(struct Depsgraph *depsgraph, struct ID *id); void BKE_animsys_eval_driver(struct Depsgraph *depsgraph, struct ID *id, int driver_index, - struct ChannelDriver *driver_orig); + struct FCurve *fcu_orig); void BKE_animsys_update_driver_array(struct ID *id); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 4f6f299ecc5..2e655452a21 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -4082,11 +4082,10 @@ void BKE_animsys_update_driver_array(ID *id) } } -void BKE_animsys_eval_driver(Depsgraph *depsgraph, - ID *id, - int driver_index, - ChannelDriver *driver_orig) +void BKE_animsys_eval_driver(Depsgraph *depsgraph, ID *id, int driver_index, FCurve *fcu_orig) { + BLI_assert(fcu_orig != NULL); + /* TODO(sergey): De-duplicate with BKE animsys. */ PointerRNA id_ptr; bool ok = false; @@ -4111,6 +4110,7 @@ void BKE_animsys_eval_driver(Depsgraph *depsgraph, if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED)) == 0) { /* check if driver itself is tagged for recalculation */ /* XXX driver recalc flag is not set yet by depsgraph! */ + ChannelDriver *driver_orig = fcu_orig->driver; if ((driver_orig) && !(driver_orig->flag & DRIVER_FLAG_INVALID)) { /* evaluate this using values set already in other places * NOTE: for 'layering' option later on, we should check if we should remove old value before @@ -4121,7 +4121,7 @@ void BKE_animsys_eval_driver(Depsgraph *depsgraph, if (animsys_store_rna_setting(&id_ptr, fcu->rna_path, fcu->array_index, &anim_rna)) { /* Evaluate driver, and write results to COW-domain destination */ const float ctime = DEG_get_ctime(depsgraph); - const float curval = evaluate_fcurve_driver(&anim_rna, fcu, driver_orig, ctime); + const float curval = calculate_fcurve(&anim_rna, fcu, ctime); ok = animsys_write_rna_setting(&anim_rna, curval); /* Flush results & status codes to original data for UI (T59984) */ @@ -4129,6 +4129,7 @@ void BKE_animsys_eval_driver(Depsgraph *depsgraph, animsys_write_orig_anim_rna(&id_ptr, fcu->rna_path, fcu->array_index, curval); /* curval is displayed in the UI, and flag contains error-status codes */ + fcu_orig->curval = fcu->curval; driver_orig->curval = fcu->driver->curval; driver_orig->flag = fcu->driver->flag; |