This patch contains two possible fixes for T76121. The root cause is this code from deg_builder_rna.c, function RNANodeQuery::construct_node_identifier():
else if (RNA_struct_is_a(ptr->type, &RNA_Mesh) || RNA_struct_is_a(ptr->type, &RNA_Modifier) ||
RNA_struct_is_a(ptr->type, &RNA_GpencilModifier) ||
RNA_struct_is_a(ptr->type, &RNA_Spline) || RNA_struct_is_a(ptr->type, &RNA_TextBox) ||
RNA_struct_is_a(ptr->type, &RNA_GPencilLayer) ||
RNA_struct_is_a(ptr->type, &RNA_LatticePoint) ||
RNA_struct_is_a(ptr->type, &RNA_MeshUVLoop) ||
RNA_struct_is_a(ptr->type, &RNA_MeshLoopColor) ||
RNA_struct_is_a(ptr->type, &RNA_VertexGroupElement)) {
/* When modifier is used as FROM operation this is likely referencing to
* the property (for example, modifier's influence).
* But when it's used as TO operation, this is geometry component. */
switch (source) {
case RNAPointerSource::ENTRY:
node_identifier.type = NodeType::GEOMETRY;
break;
case RNAPointerSource::EXIT:
node_identifier.type = NodeType::PARAMETERS;
node_identifier.operation_code = OperationCode::PARAMETERS_EVAL;
break;
}
return node_identifier;
}The example file in T76121 has an animated modifier property that's used as variable in a driver.
Building the relations for the driver target creates the relation PARAMETERS_EVAL → DRIVER(variable) (blue in the image below).
Building the relations for the FCurve targeting the modifier property creates the relation ANIMATION_EXIT → GEOMETRY_EVAL_INIT (green in the image below).
This means that there is NOT a relation ANIMATION_EXIT → PARAMETERS_EVAL, and as a result, the driver is not properly updated when its variable reads animated data. This can be resolved by adding the missing relation (red in the image below).
This missing relation can be added in two different spots, namely when building the driver or the animation relations. Both feel a bit like a hack, though, as either is then tightly coupled with the behaviour of RNANodeQuery::construct_node_identifier(). To me the root cause seems to be that that particular function can only deal with a single relation, while in this case multiple relations would be required. Resolving this, however, would be quite an undertaking.
@Sergey Sharybin (sergey) Do you find this solution acceptable? And if so, which of the two locations for adding the missing relation would have your preference?
