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:
authorCampbell Barton <ideasman42@gmail.com>2013-08-29 06:32:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-29 06:32:51 +0400
commit95fcf02500408e6457806e8a293572b9ef91381a (patch)
tree97ccd8d57e3e26f895b46a36a08081afaa04ca01 /source/blender/blenkernel
parente7d725eefda42ec315d887cfa91c733f26b0f3b1 (diff)
patch [#36336] Split operator for curves and surfaces
by Kevin Mackay (yakca) The operator follows roughly the same behaviour as the split operator for a mesh (Ykey).
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_curve.h1
-rw-r--r--source/blender/blenkernel/intern/curve.c18
2 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index f3b3810b587..609b7e4ae4b 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -150,6 +150,7 @@ void BKE_nurb_bezt_calc_normal(struct Nurb *nu, struct BezTriple *bezt, float r_
void BKE_nurb_bezt_calc_plane(struct Nurb *nu, struct BezTriple *bezt, float r_plane[3]);
void BKE_nurb_handle_calc(struct BezTriple *bezt, struct BezTriple *prev, struct BezTriple *next, int mode);
+void BKE_nurb_handle_calc_simple(struct Nurb *nu, struct BezTriple *bezt);
void BKE_nurb_handles_calc(struct Nurb *nu);
void BKE_nurb_handles_autocalc(struct Nurb *nu, int flag);
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index e41b1999198..dd5932af895 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -3084,6 +3084,24 @@ void BKE_nurb_handles_calc(Nurb *nu) /* first, if needed, set handle flags */
calchandlesNurb_intern(nu, FALSE);
}
+/* similar to BKE_nurb_handle_calc but for curves and
+ * figures out the previous and next for us */
+void BKE_nurb_handle_calc_simple(Nurb *nu, BezTriple *bezt)
+{
+ int index = (int)(bezt - nu->bezt);
+ BezTriple *prev, *next;
+
+ BLI_assert(ARRAY_HAS_ITEM(bezt, nu->bezt, nu->pntsu));
+
+ if (index == 0) {
+ prev = (nu->flag & CU_NURB_CYCLIC) ? &nu->bezt[nu->pntsu - 1] : NULL;
+ }
+ if (index == nu->pntsu - 1) {
+ next = (nu->flag & CU_NURB_CYCLIC) ? &nu->bezt[0] : NULL;
+ }
+
+ BKE_nurb_handle_calc(bezt, prev, next, 0);
+}
void BKE_nurb_handles_test(Nurb *nu)
{