From 6122b6e22dc04f41c2ee06f78577f2857db71fd0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 26 Mar 2024 13:58:55 +0100 Subject: [PATCH] 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 --- .../depsgraph/intern/builder/deg_builder_relations.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 96119c07514..691f60f407e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -2659,6 +2659,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: