Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/curves/intern/curves_ops.cc
| Show First 20 Lines • Show All 894 Lines • ▼ Show 20 Lines | static int select_all_exec(bContext *C, wmOperator *op) | ||||
| VectorSet<Curves *> unique_curves = get_unique_editable_curves(*C); | VectorSet<Curves *> unique_curves = get_unique_editable_curves(*C); | ||||
| if (action == SEL_TOGGLE) { | if (action == SEL_TOGGLE) { | ||||
| action = any_point_selected(unique_curves) ? SEL_DESELECT : SEL_SELECT; | action = any_point_selected(unique_curves) ? SEL_DESELECT : SEL_SELECT; | ||||
| } | } | ||||
| for (Curves *curves_id : unique_curves) { | for (Curves *curves_id : unique_curves) { | ||||
| if (action == SEL_SELECT) { | if (action == SEL_SELECT) { | ||||
| /* The optimization to avoid storing the selection when everything is selected causes too | /* As an optimization, just remove the selection attributes when everything is selected. */ | ||||
| * many problems at the moment, since there is no proper visualization yet. Keep the code but | |||||
| * disable it for now. */ | |||||
| #if 0 | |||||
| CurveComponent component; | CurveComponent component; | ||||
| component.replace(curves_id, GeometryOwnershipType::Editable); | component.replace(curves_id, GeometryOwnershipType::Editable); | ||||
| component.attribute_try_delete(".selection_point_float"); | component.attribute_try_delete(".selection_point_float"); | ||||
| component.attribute_try_delete(".selection_curve_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 { | else { | ||||
| CurvesGeometry &curves = CurvesGeometry::wrap(curves_id->geometry); | CurvesGeometry &curves = CurvesGeometry::wrap(curves_id->geometry); | ||||
| MutableSpan<float> selection = curves_id->selection_domain == ATTR_DOMAIN_POINT ? | MutableSpan<float> selection = curves_id->selection_domain == ATTR_DOMAIN_POINT ? | ||||
| curves.selection_point_float_for_write() : | curves.selection_point_float_for_write() : | ||||
| curves.selection_curve_float_for_write(); | curves.selection_curve_float_for_write(); | ||||
| if (action == SEL_DESELECT) { | if (action == SEL_DESELECT) { | ||||
| selection.fill(0.0f); | selection.fill(0.0f); | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||