Fix #119907: Active curve vertex/spline not visualizing properly

A regression caused by 7a2d04a5c4.

The offending commit made it so selection tag does not imply parameters
update, which also avoids transitive re-evaluation of the curve geometry.
However, the active curve index is stored on a Curve, and curve modifier
stack creates a copy of the curve to hold the evaluation results, which
makes it so evaluated curve object does not intrinsically share the active
spline index.

This change makes it so changes in selection triggers geometry evaluation
on curves, matching the behavior prior to the offending commit.

AN ideal fix would somehow avoid such geometry re-evaluation, but it would
be a bigger change, not suitable for possible corrective release.

Potential candidate for 4.1.1.

Pull Request: https://projects.blender.org/blender/blender/pulls/119918
This commit is contained in:
Sergey Sharybin 2024-03-26 13:58:55 +01:00 committed by Sergey Sharybin
parent 9c3eceb8c8
commit d3504a6bab
1 changed files with 11 additions and 0 deletions

View File

@ -2666,6 +2666,17 @@ void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata)
add_relation(textoncurve_key, obdata_geom_eval_key, "Text on Curve Transform");
build_object(cu->textoncurve);
}
/* Special relation to ensure active spline index gets properly updated.
*
* The active spline index is stored on the Curve data-block, and the curve evaluation might
* create a new curve data-block for the result, which does not intrinsically sharing the
* active spline index. Hence a special relation is added to ensure the modifier stack is
* evaluated when selection changes. */
{
const OperationKey object_data_select_key(
obdata, NodeType::BATCH_CACHE, OperationCode::GEOMETRY_SELECT_UPDATE);
add_relation(object_data_select_key, obdata_geom_eval_key, "Active Spline Update");
}
break;
}
case ID_LT: