Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc
| Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | static void set_position_in_component(const GeometryNodeCurveHandleMode mode, | ||||
| current_point = 0; | current_point = 0; | ||||
| current_mask = 0; | current_mask = 0; | ||||
| for (const SplinePtr &spline : curve->splines()) { | for (const SplinePtr &spline : curve->splines()) { | ||||
| if (spline->type() == CURVE_TYPE_BEZIER) { | if (spline->type() == CURVE_TYPE_BEZIER) { | ||||
| BezierSpline &bezier = static_cast<BezierSpline &>(*spline); | BezierSpline &bezier = static_cast<BezierSpline &>(*spline); | ||||
| for (const int i : bezier.positions().index_range()) { | for (const int i : bezier.positions().index_range()) { | ||||
| if (current_mask < selection.size() && selection[current_mask] == current_point) { | if (current_mask < selection.size() && selection[current_mask] == current_point) { | ||||
| if (mode & GEO_NODE_CURVE_HANDLE_LEFT) { | if (mode & GEO_NODE_CURVE_HANDLE_LEFT) { | ||||
| bezier.set_handle_position_left(i, positions_input[i] + offsets_input[i]); | bezier.set_handle_position_left( | ||||
| i, positions_input[current_point] + offsets_input[current_point]); | |||||
| } | } | ||||
| else { | else { | ||||
| bezier.set_handle_position_right(i, positions_input[i] + offsets_input[i]); | bezier.set_handle_position_right( | ||||
| i, positions_input[current_point] + offsets_input[current_point]); | |||||
| } | } | ||||
| current_mask++; | current_mask++; | ||||
| } | } | ||||
| current_point++; | current_point++; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| for ([[maybe_unused]] int i : spline->positions().index_range()) { | for ([[maybe_unused]] int i : spline->positions().index_range()) { | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||