[Bf-blender-cvs] [4e8b8f85215] soc-2021-curves: Bug fix: error when selecting NURBS spline
dilithjay
noreply at git.blender.org
Fri Aug 6 05:15:11 CEST 2021
Commit: 4e8b8f85215def80260db70468ecd36f04e0ac32
Author: dilithjay
Date: Thu Aug 5 19:21:39 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB4e8b8f85215def80260db70468ecd36f04e0ac32
Bug fix: error when selecting NURBS spline
===================================================================
M source/blender/editors/curve/editcurve_pen.c
===================================================================
diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c
index 361c657fa0c..f1a7b1bc5ae 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -44,7 +44,7 @@
#include "RNA_define.h"
/* Data structure to keep track of details about the cut location */
-typedef struct CutBeztData {
+typedef struct CutData {
/* Index of the last bez triple before the cut. */
int bezt_index, bp_index;
/* Nurb to which the cut belongs to. */
@@ -706,6 +706,7 @@ static bool is_curve_nearby(ViewContext *vc, wmOperator *op, const wmEvent *even
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
CutData data = {.bezt_index = 0,
+ .bp_index = 0,
.min_dist = 10000,
.parameter = 0.5f,
.has_prev = false,
@@ -716,7 +717,7 @@ static bool is_curve_nearby(ViewContext *vc, wmOperator *op, const wmEvent *even
update_data_for_all_nurbs(nurbs, vc, &data);
float threshold_distance = get_view_zoom(data.cut_loc, vc);
- if (data.min_dist < threshold_distance) {
+ if (!data.nurb->bp && data.min_dist < threshold_distance) {
MoveSegmentData *seg_data;
op->customdata = seg_data = MEM_callocN(sizeof(MoveSegmentData), "MoveSegmentData");
seg_data->bezt_index = data.bezt_index;
@@ -815,8 +816,8 @@ static bool close_loop_if_endpoints(
curve_toggle_cyclic(v3d, editnurb, 0);
return true;
}
- return false;
}
+ return false;
}
enum {
More information about the Bf-blender-cvs
mailing list