diff options
author | Antonioya <blendergit@gmail.com> | 2019-01-11 21:15:23 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-01-11 21:21:56 +0300 |
commit | bb9c9d0eaaab836b8f20ab7b2228795f607b823a (patch) | |
tree | 8fd6ebad4084c66e6d1a49849ed6b9dbbc126d22 /source/blender/makesdna | |
parent | 6dbfd7f6d6bc9bea9556861eba682a3126b5ed40 (diff) |
GP: New Cutter, Constraints and Segment selection
This commit groups a set of new tools that were tested in grease pencil object branch before moving to master. We decide to do all the development in a separated branch because it could break master during days or weeks before the new tools were ready to deploy.
The commit includes:
- New Cutter tool to trim strokes and help cleaning up drawings.
- New set of constraints and guides to draw different types of shapes. All the credits for this development goes to Charlie Jolly (@charlie), thanks for your help!
- Segment selection mode to select strokes between intersections.
- New operator to change strokes cap mode.
- New option to display only keyframed frames. This option is very important when fill strokes with color.
- Multiple small fixes and tweaks.
Thanks to @pepeland and @mendio for their ideas, tests, reviews and support.
Note: Still pending the final icons for Cutter in Toolbar and Segment Selection in Topbar. @billreynish could help us here?
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_types.h | 14 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 39 |
2 files changed, 49 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 0ae193752a8..17813021fdf 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -203,7 +203,8 @@ typedef struct bGPDstroke { /** Material index. */ int mat_nr; - char _pad1[4]; + /** Caps mode for each stroke extreme */ + short caps[2]; /** Vertex weight data. */ struct MDeformVert *dvert; @@ -232,6 +233,15 @@ typedef enum eGPDstroke_Flag { GP_STROKE_ERASER = (1 << 15) } eGPDstroke_Flag; +/* bGPDstroke->caps */ +typedef enum eGPDstroke_Caps { + /* type of extreme */ + GP_STROKE_CAP_ROUND = 0, + GP_STROKE_CAP_FLAT = 1, + + GP_STROKE_CAP_MAX +} GPDstroke_Caps; + /* ***************************************** */ /* GP Frame */ @@ -371,6 +381,8 @@ typedef enum eGPDlayer_Flag { GP_LAYER_UNLOCK_COLOR = (1 << 12), /* Mask Layer */ GP_LAYER_USE_MASK = (1 << 13), + /* Flag used to display in Paint mode only layers with keyframe */ + GP_LAYER_SOLO_MODE = (1 << 4), } eGPDlayer_Flag; /* bGPDlayer->onion_flag */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 3186e8a435b..fd68d8e0d74 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1073,6 +1073,20 @@ typedef struct GP_Sculpt_Data { char _pad[4]; } GP_Sculpt_Data; +/* Settings for a GPencil Speed Guide */ +typedef struct GP_Sculpt_Guide { + char use_guide; + char use_snapping; + char reference_point; + char type; + char _pad2[4]; + float angle; + float angle_snap; + float spacing; + float location[3]; + struct Object *reference_object; +} GP_Sculpt_Guide; + /* GP_Sculpt_Data.flag */ typedef enum eGP_Sculpt_Flag { /* invert the effect of the brush */ @@ -1106,7 +1120,8 @@ typedef struct GP_Sculpt_Settings { int flag; /** #eGP_Lockaxis_Types lock drawing to one axis. */ int lock_axis; - char pad1[4]; + /** Threshold for intersections */ + float isect_threshold; /* weight paint is a submode of sculpt but use its own index. All weight paint * brushes must be defined at the end of the brush array. @@ -1118,6 +1133,8 @@ typedef struct GP_Sculpt_Settings { struct CurveMapping *cur_falloff; /** Curve used for primitve tools. */ struct CurveMapping *cur_primitive; + /** Guides used for paint tools */ + struct GP_Sculpt_Guide guide; } GP_Sculpt_Settings; /* GP_Sculpt_Settings.flag */ @@ -2317,10 +2334,26 @@ typedef enum eGPencil_Placement_Flags { /* ToolSettings.gpencil_selectmode */ typedef enum eGPencil_Selectmode_types { - GP_SELECTMODE_POINT = 0, - GP_SELECTMODE_STROKE = 1 + GP_SELECTMODE_POINT = 0, + GP_SELECTMODE_STROKE = 1, + GP_SELECTMODE_SEGMENT = 2 } eGPencil_Selectmode_types; +/* ToolSettings.gpencil_guide_types */ +typedef enum eGPencil_GuideTypes { + GP_GUIDE_CIRCULAR = 0, + GP_GUIDE_RADIAL, + GP_GUIDE_PARALLEL, + GP_GUIDE_GRID +} eGPencil_GuideTypes; + +/* ToolSettings.gpencil_guide_references */ +typedef enum eGPencil_Guide_Reference { + GP_GUIDE_REF_CURSOR = 0, + GP_GUIDE_REF_CUSTOM, + GP_GUIDE_REF_OBJECT +} eGPencil_Guide_Reference; + /* ToolSettings.particle flag */ #define PE_KEEP_LENGTHS (1 << 0) #define PE_LOCK_FIRST (1 << 1) |