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:
authorHans Goudey <h.goudey@me.com>2020-06-24 18:50:01 +0300
committerHans Goudey <h.goudey@me.com>2020-06-24 18:50:01 +0300
commitbaff05ad1c156ca477375c440e2c5b92cad214e9 (patch)
treeb89d9d5a9e9611247d964d5e9b0ccd098bf88c2d /source/blender/blenkernel/BKE_curveprofile.h
parentec7510b458528eb8dcdf2c538a2b805813940447 (diff)
UI: Add Free Handle Types to CurveProfile Widget
Under the hood the CurveProfile widget (used for bevel custom profiles) uses a bezier curve, but right now though it only supports two of the bezier curve handle types, vector and auto. This patch adds support for free handles and adds all of the logic for editing them. This is the first step to the ability to import and export curve objects in the widget. There's some code cleanup in curveprofile.c. Movement for handles and control points is abstracted to functions there rather than happening in interface_handlers.c. An "Apply Preset" button is also added, which solves a confusing issue where you apply a preset, then change the number of samples and the preset doesn't change. The button makes it clear that the preset needs to be reapplied. Reviewed By: Severin Differential Revision: https://developer.blender.org/D6470
Diffstat (limited to 'source/blender/blenkernel/BKE_curveprofile.h')
-rw-r--r--source/blender/blenkernel/BKE_curveprofile.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_curveprofile.h b/source/blender/blenkernel/BKE_curveprofile.h
index bf50cde1efc..877ab887138 100644
--- a/source/blender/blenkernel/BKE_curveprofile.h
+++ b/source/blender/blenkernel/BKE_curveprofile.h
@@ -45,6 +45,16 @@ void BKE_curveprofile_copy_data(struct CurveProfile *target, const struct CurveP
struct CurveProfile *BKE_curveprofile_copy(const struct CurveProfile *profile);
+bool BKE_curveprofile_move_handle(struct CurveProfilePoint *point,
+ const bool handle_1,
+ const bool snap,
+ const float delta[2]);
+
+bool BKE_curveprofile_move_point(struct CurveProfile *profile,
+ struct CurveProfilePoint *point,
+ const bool snap,
+ const float delta[2]);
+
bool BKE_curveprofile_remove_point(struct CurveProfile *profile, struct CurveProfilePoint *point);
void BKE_curveprofile_remove_by_flag(struct CurveProfile *profile, const short flag);
@@ -65,7 +75,12 @@ void BKE_curveprofile_create_samples(struct CurveProfile *profile,
void BKE_curveprofile_initialize(struct CurveProfile *profile, short segments_len);
/* Called for a complete update of the widget after modifications */
-void BKE_curveprofile_update(struct CurveProfile *profile, const bool rem_doubles);
+enum {
+ PROF_UPDATE_NONE = 0,
+ PROF_UPDATE_REMOVE_DOUBLES = (1 << 0),
+ PROF_UPDATE_CLIP = (1 << 1),
+};
+void BKE_curveprofile_update(struct CurveProfile *profile, const int update_flags);
/* Need to find the total length of the curve to sample a portion of it */
float BKE_curveprofile_total_length(const struct CurveProfile *profile);