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:
authorPhilipp Oeser <info@graphics-engineer.com>2020-02-04 23:24:48 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-02-04 23:24:48 +0300
commit78ba097331c4b12b7c3cddf89a35135efcdcf17e (patch)
treeab7b1764e73e8567ff2b1a49d28f253d41446629 /source/blender
parentf3fec859ba5d79134dfe34ecfcf5c2962035569f (diff)
parent559d01e12949a730f3497fdfbe79a11f532f3afe (diff)
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_curve.h5
-rw-r--r--source/blender/blenkernel/intern/curve.c8
-rw-r--r--source/blender/editors/curve/editcurve.c5
-rw-r--r--source/blender/editors/gpencil/gpencil_convert.c2
-rw-r--r--source/blender/makesrna/intern/rna_curve.c2
5 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index e03780cc027..cf516c630c5 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -220,7 +220,10 @@ bool BKE_nurb_order_clamp_u(struct Nurb *nu);
bool BKE_nurb_order_clamp_v(struct Nurb *nu);
void BKE_nurb_direction_switch(struct Nurb *nu);
-bool BKE_nurb_type_convert(struct Nurb *nu, const short type, const bool use_handles);
+bool BKE_nurb_type_convert(struct Nurb *nu,
+ const short type,
+ const bool use_handles,
+ const char **r_err_msg);
void BKE_nurb_points_add(struct Nurb *nu, int number);
void BKE_nurb_bezierPoints_add(struct Nurb *nu, int number);
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 4f0ff8bdcd3..8246c3d9ff4 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -4869,7 +4869,10 @@ bool BKE_nurb_order_clamp_v(struct Nurb *nu)
/**
* \note caller must ensure active vertex remains valid.
*/
-bool BKE_nurb_type_convert(Nurb *nu, const short type, const bool use_handles)
+bool BKE_nurb_type_convert(Nurb *nu,
+ const short type,
+ const bool use_handles,
+ const char **r_err_msg)
{
BezTriple *bezt;
BPoint *bp;
@@ -4976,6 +4979,9 @@ bool BKE_nurb_type_convert(Nurb *nu, const short type, const bool use_handles)
nr = nu->pntsu / 3;
if (nr < 2) {
+ if (r_err_msg != NULL) {
+ *r_err_msg = "At least 6 points required for conversion";
+ }
return false; /* conversion impossible */
}
else {
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index e7803fdaafb..f5920bfb258 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -4002,14 +4002,15 @@ static int set_spline_type_exec(bContext *C, wmOperator *op)
for (nu = editnurb->first; nu; nu = nu->next) {
if (ED_curve_nurb_select_check(v3d, nu)) {
const int pntsu_prev = nu->pntsu;
- if (BKE_nurb_type_convert(nu, type, use_handles)) {
+ const char *err_msg = NULL;
+ if (BKE_nurb_type_convert(nu, type, use_handles, &err_msg)) {
changed = true;
if (pntsu_prev != nu->pntsu) {
changed_size = true;
}
}
else {
- BKE_report(op->reports, RPT_ERROR, "No conversion possible");
+ BKE_report(op->reports, RPT_ERROR, err_msg);
}
}
}
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c
index 1ce4ffbbd46..e1b13747ee0 100644
--- a/source/blender/editors/gpencil/gpencil_convert.c
+++ b/source/blender/editors/gpencil/gpencil_convert.c
@@ -1385,7 +1385,7 @@ static void gp_layer_to_curve(bContext *C,
if (mode == GP_STROKECONVERT_POLY) {
for (nu = cu->nurb.first; nu; nu = nu->next) {
- BKE_nurb_type_convert(nu, CU_POLY, false);
+ BKE_nurb_type_convert(nu, CU_POLY, false, NULL);
}
}
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index b295a169c83..ff132b52eb3 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -384,7 +384,7 @@ static void rna_Nurb_type_set(PointerRNA *ptr, int value)
Nurb *nu = (Nurb *)ptr->data;
const int pntsu_prev = nu->pntsu;
- if (BKE_nurb_type_convert(nu, value, true)) {
+ if (BKE_nurb_type_convert(nu, value, true, NULL)) {
if (nu->pntsu != pntsu_prev) {
cu->actvert = CU_ACT_NONE;
}