[Bf-blender-cvs] [3ac022d328f] soc-2021-curves: Minor cleanup
dilithjay
noreply at git.blender.org
Sat Dec 4 17:40:40 CET 2021
Commit: 3ac022d328f52364c58a9de97e8b19b7f1b3f679
Author: dilithjay
Date: Fri Dec 3 22:17:26 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB3ac022d328f52364c58a9de97e8b19b7f1b3f679
Minor cleanup
===================================================================
M release/datafiles/locale
M release/scripts/addons
M release/scripts/addons_contrib
M source/blender/editors/curve/editcurve_pen.c
M source/tools
===================================================================
diff --git a/release/datafiles/locale b/release/datafiles/locale
index 78b4e0c9a51..3a78acbab9f 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 78b4e0c9a513650b961826aeeafc324487f5e1aa
+Subproject commit 3a78acbab9f63b18e93c1fa72b68a85e1bdeba05
diff --git a/release/scripts/addons b/release/scripts/addons
index 6274264545c..a444e8cc19a 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 6274264545c61a74e6093b0243e9b973dcd50d19
+Subproject commit a444e8cc19a4353ce35ecdec9bb7894ee73a204a
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 16467648282..7936dde9ece 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 16467648282500cc229c271f62201ef897f2c2c3
+Subproject commit 7936dde9ece881d531b1a2ee6c45ddb56d30038c
diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c
index be4a382b376..f7a5a7d2b5d 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -366,13 +366,10 @@ static void update_data_if_closest_bezt_in_segment(const BezTriple *bezt1,
Nurb *nu,
const int index,
const ViewContext *vc,
- void *op_data)
+ CutData *data)
{
-
- CutData *data = op_data;
-
const float resolu = nu->resolu;
- float *points = MEM_mallocN(sizeof(float[3]) * (resolu + 1), "makeCut_bezier");
+ float *points = MEM_mallocN(sizeof(float[3]) * (resolu + 1), __func__);
/* Calculate all points on curve. */
for (int j = 0; j < 3; j++) {
@@ -429,9 +426,8 @@ static void get_bezier_interpolated_point(float r_point[3],
}
/* Update the closest location as cut location in data. */
-static void update_cut_loc_in_data(void *op_data, const ViewContext *vc)
+static void update_cut_loc_in_data(CutData *data, const ViewContext *vc)
{
- CutData *data = op_data;
bool found_min = false;
float point[3];
float factor;
@@ -482,10 +478,8 @@ static void calculate_new_bezier_point(const float point_prev[3],
}
/* Update the nearest point data for all nurbs. */
-static void update_data_for_all_nurbs(const ListBase *nurbs, const ViewContext *vc, void *op_data)
+static void update_data_for_all_nurbs(const ListBase *nurbs, const ViewContext *vc, CutData *data)
{
- CutData *data = op_data;
-
LISTBASE_FOREACH (Nurb *, nu, nurbs) {
if (nu->type == CU_BEZIER) {
float screen_co[2];
@@ -537,13 +531,11 @@ static void update_data_for_all_nurbs(const ListBase *nurbs, const ViewContext *
}
/* Insert a #BezTriple to a nurb at the location specified by `op_data`. */
-static void add_bezt_to_nurb(Nurb *nu, const void *op_data, Curve *cu)
+static void add_bezt_to_nurb(Nurb *nu, const CutData *data, Curve *cu)
{
EditNurb *editnurb = cu->editnurb;
- const CutData *data = op_data;
- BezTriple *bezt1 = (BezTriple *)MEM_mallocN((nu->pntsu + 1) * sizeof(BezTriple),
- "new_bezt_nurb");
+ BezTriple *bezt1 = (BezTriple *)MEM_mallocN((nu->pntsu + 1) * sizeof(BezTriple), __func__);
const int index = data->bezt_index + 1;
/* Copy all control points before the cut to the new memory. */
memcpy(bezt1, nu->bezt, index * sizeof(BezTriple));
@@ -592,12 +584,11 @@ static void add_bezt_to_nurb(Nurb *nu, const void *op_data, Curve *cu)
}
/* Insert a #BPoint to a nurb at the location specified by `op_data`. */
-static void add_bp_to_nurb(Nurb *nu, const void *op_data, Curve *cu)
+static void add_bp_to_nurb(Nurb *nu, const CutData *data, Curve *cu)
{
EditNurb *editnurb = cu->editnurb;
- const CutData *data = op_data;
- BPoint *bp1 = (BPoint *)MEM_mallocN((nu->pntsu + 1) * sizeof(BPoint), "new_bp_nurb");
+ BPoint *bp1 = (BPoint *)MEM_mallocN((nu->pntsu + 1) * sizeof(BPoint), __func__);
const int index = data->bp_index + 1;
/* Copy all control points before the cut to the new memory. */
memcpy(bp1, nu->bp, index * sizeof(BPoint));
@@ -732,7 +723,7 @@ static bool is_spline_nearby(ViewContext *vc, wmOperator *op, const wmEvent *eve
const float threshold_distance = ED_view3d_select_dist_px();
if (data.nurb && !data.nurb->bp && data.min_dist < threshold_distance) {
MoveSegmentData *seg_data;
- op->customdata = seg_data = MEM_callocN(sizeof(MoveSegmentData), "MoveSegmentData");
+ op->customdata = seg_data = MEM_callocN(sizeof(MoveSegmentData), __func__);
seg_data->bezt_index = data.bezt_index;
seg_data->nu = data.nurb;
return true;
diff --git a/source/tools b/source/tools
index cc857792a49..26bc78162ec 160000
--- a/source/tools
+++ b/source/tools
@@ -1 +1 @@
-Subproject commit cc857792a49b4b9cab51f185803cdecdaa10e6eb
+Subproject commit 26bc78162ec89f21453ce3ded7b999bc6649f32b
More information about the Bf-blender-cvs
mailing list