Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-07-07 16:06:30 +0300
committerHans Goudey <h.goudey@me.com>2022-07-07 16:06:30 +0300
commite3ef56ef91417519a3301746f4cfd244cd08ef85 (patch)
tree8995e7532d15c64de3c4629aba7b528376a1c4c6 /source/blender/editors/curves
parent5d6e7df4a8b70aa98d86655b024a87ca3319c6be (diff)
Curves: Add sculpt selection overlay
This commit adds visualization to the selection in curves sculpt mode. Previously it was only possible to see the selection when it was connected to a material. In order to obstruct the users vision as little as possible, the selected areas of the curve are left as is, but a dark overlay is drawn over unselected areas. To make it work, the overlay requests the selection attribute and then ensures that the evaluation is complete for curves. Then it retrieves the evaluated selection GPU texture and passes that to the shader. This reuses the existing generic attribute extraction system because there currently wouldn't be any benefits to dealing with selection separately, and because it avoids duplication of the logic that extracts attributes from curves and evaluates them if necessary. Differential Revision: https://developer.blender.org/D15219
Diffstat (limited to 'source/blender/editors/curves')
-rw-r--r--source/blender/editors/curves/intern/curves_ops.cc12
1 files changed, 1 insertions, 11 deletions
diff --git a/source/blender/editors/curves/intern/curves_ops.cc b/source/blender/editors/curves/intern/curves_ops.cc
index d9f207103ae..a6ae1ba5e24 100644
--- a/source/blender/editors/curves/intern/curves_ops.cc
+++ b/source/blender/editors/curves/intern/curves_ops.cc
@@ -900,21 +900,11 @@ static int select_all_exec(bContext *C, wmOperator *op)
for (Curves *curves_id : unique_curves) {
if (action == SEL_SELECT) {
- /* The optimization to avoid storing the selection when everything is selected causes too
- * many problems at the moment, since there is no proper visualization yet. Keep the code but
- * disable it for now. */
-#if 0
+ /* As an optimization, just remove the selection attributes when everything is selected. */
CurveComponent component;
component.replace(curves_id, GeometryOwnershipType::Editable);
component.attribute_try_delete(".selection_point_float");
component.attribute_try_delete(".selection_curve_float");
-#else
- CurvesGeometry &curves = CurvesGeometry::wrap(curves_id->geometry);
- MutableSpan<float> selection = curves_id->selection_domain == ATTR_DOMAIN_POINT ?
- curves.selection_point_float_for_write() :
- curves.selection_curve_float_for_write();
- selection.fill(1.0f);
-#endif
}
else {
CurvesGeometry &curves = CurvesGeometry::wrap(curves_id->geometry);