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
This commit is contained in:
2019-09-25 10:31:34 +02:00
parent d0279f7d36
commit fbfa904bce
3 changed files with 13 additions and 14 deletions

View File

@@ -900,19 +900,17 @@ void DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcurve, int driver_index
{
/* Create data node for this driver */
ID *id_cow = get_cow_id(id);
ChannelDriver *driver_orig = fcurve->driver;
/* TODO(sergey): ideally we could pass the COW of fcu, but since it
* has not yet been allocated at this point we can't. As a workaround
* the animation systems allocates an array so we can do a fast lookup
* with the driver index. */
ensure_operation_node(
id,
NodeType::PARAMETERS,
OperationCode::DRIVER,
function_bind(BKE_animsys_eval_driver, _1, id_cow, driver_index, driver_orig),
fcurve->rna_path ? fcurve->rna_path : "",
fcurve->array_index);
ensure_operation_node(id,
NodeType::PARAMETERS,
OperationCode::DRIVER,
function_bind(BKE_animsys_eval_driver, _1, id_cow, driver_index, fcurve),
fcurve->rna_path ? fcurve->rna_path : "",
fcurve->array_index);
build_driver_variables(id, fcurve);
}