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:
authorAntonio Vazquez <blendergit@gmail.com>2020-05-26 11:37:47 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-05-26 11:37:47 +0300
commit49f59092e7c8c652df015bdfd27bae2480e51d01 (patch)
tree7360626291190beb7537370efc7a9a7d5af7203f /source/blender/makesdna
parent495a98d623648ca787ddb2c0dbaa08fe313f1adf (diff)
Curves: Implement Handles for selected points only
When editing a complex curve is very annoying to have all handles at a time. Also, this is a requirement for the current GSoC Edit Grease Pencil using curves. I have seen that this improvement can be used in any other area of blender, so I have decided to publish the option in the overlay panel.. Reviewed By: fclem, #user_interface, billreynish, Severin Differential Revision: https://developer.blender.org/D7754
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_curve_types.h4
-rw-r--r--source/blender/makesdna/DNA_view3d_defaults.h4
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h17
3 files changed, 19 insertions, 6 deletions
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index 6a081a7f5a7..b2902407a15 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -496,11 +496,11 @@ typedef enum eBezTriple_KeyframeType {
#define BEZT_ISSEL_ALL(bezt) \
(((bezt)->f2 & SELECT) && ((bezt)->f1 & SELECT) && ((bezt)->f3 & SELECT))
#define BEZT_ISSEL_ALL_HIDDENHANDLES(v3d, bezt) \
- ((((v3d) != NULL) && ((v3d)->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_HANDLES) == 0) ? \
+ ((((v3d) != NULL) && ((v3d)->overlay.handle_display == CURVE_HANDLE_NONE)) ? \
(bezt)->f2 & SELECT : \
BEZT_ISSEL_ALL(bezt))
#define BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt) \
- ((((v3d) != NULL) && ((v3d)->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_HANDLES) == 0) ? \
+ ((((v3d) != NULL) && ((v3d)->overlay.handle_display == CURVE_HANDLE_NONE)) ? \
(bezt)->f2 & SELECT : \
BEZT_ISSEL_ANY(bezt))
diff --git a/source/blender/makesdna/DNA_view3d_defaults.h b/source/blender/makesdna/DNA_view3d_defaults.h
index 20b491c47f2..10eadf368ef 100644
--- a/source/blender/makesdna/DNA_view3d_defaults.h
+++ b/source/blender/makesdna/DNA_view3d_defaults.h
@@ -64,8 +64,8 @@
.edit_flag = V3D_OVERLAY_EDIT_FACES | V3D_OVERLAY_EDIT_SEAMS | \
V3D_OVERLAY_EDIT_SHARP | V3D_OVERLAY_EDIT_FREESTYLE_EDGE | \
V3D_OVERLAY_EDIT_FREESTYLE_FACE | V3D_OVERLAY_EDIT_EDGES | \
- V3D_OVERLAY_EDIT_CREASES | V3D_OVERLAY_EDIT_BWEIGHTS | \
- V3D_OVERLAY_EDIT_CU_HANDLES, \
+ V3D_OVERLAY_EDIT_CREASES | V3D_OVERLAY_EDIT_BWEIGHTS, \
+ .handle_display = CURVE_HANDLE_SELECTED, \
\
.gpencil_paper_opacity = 0.5f, \
.gpencil_grid_opacity = 0.9f, \
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 6d8d16c4313..ef174f5858f 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -228,9 +228,20 @@ typedef struct View3DOverlay {
/** Factor for mixing vertex paint with original color */
float gpencil_vertex_paint_opacity;
- char _pad4[4];
+ /** Handles display type for curves. */
+ int handle_display;
} View3DOverlay;
+/* View3DOverlay->handle_display */
+typedef enum eHandleDisplay {
+ /* Display only selected points. */
+ CURVE_HANDLE_SELECTED = 0,
+ /* Display all handles. */
+ CURVE_HANDLE_ALL = 1,
+ /* No display handles. */
+ CURVE_HANDLE_NONE = 2,
+} eHandleDisplay;
+
typedef struct View3D_Runtime {
/** Nkey panel stores stuff here. */
void *properties_storage;
@@ -522,7 +533,9 @@ enum {
V3D_OVERLAY_EDIT_FACE_AREA = (1 << 18),
V3D_OVERLAY_EDIT_INDICES = (1 << 19),
- V3D_OVERLAY_EDIT_CU_HANDLES = (1 << 20),
+ /* Deprecated. */
+ /* V3D_OVERLAY_EDIT_CU_HANDLES = (1 << 20), */
+
V3D_OVERLAY_EDIT_CU_NORMALS = (1 << 21),
};