diff options
author | Antonioya <blendergit@gmail.com> | 2019-03-04 21:31:36 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-03-04 21:40:50 +0300 |
commit | 8df5e0eb66f7f222f182205ff7ff32f765f6cb27 (patch) | |
tree | 20de2fbd140e65d728893ce4b25367363bb5e3a4 /source/blender/editors/gpencil/gpencil_ops.c | |
parent | 937e9b4318e0901af349f6a847d9668375f2b392 (diff) |
GPencil: New extrude operator
Keymap: E - Extrude Gizmo supported.
If the extrude points are the first or last of the stroke, the stroke is extended.
If the extrude points are in the middle of the stroke, a new stroke is created because the grease pencil strokes can be only with 2 extremes and fold the stroke to get a new point gets very bad results.
Still pending define a new icon. Also, it could be good to set by default XYZ axis in the gizmo.
Note: There is a change in the transform_gizmo_extrude_3d.c gizmo for OB_MODE_EDIT_GPENCIL. This change must be undo when the mode will be integrated into OB_MODE_EDIT, but while we have both modes, we need to keep this code in order to keep running the gizmo.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_ops.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_ops.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index 60b2fb5d64e..e3b13b26672 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -254,6 +254,7 @@ void ED_operatortypes_gpencil(void) WM_operatortype_append(GPENCIL_OT_dissolve); WM_operatortype_append(GPENCIL_OT_copy); WM_operatortype_append(GPENCIL_OT_paste); + WM_operatortype_append(GPENCIL_OT_extrude); WM_operatortype_append(GPENCIL_OT_move_to_layer); WM_operatortype_append(GPENCIL_OT_layer_change); @@ -361,6 +362,13 @@ void ED_operatormacros_gpencil(void) otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_boolean_set(otmacro->ptr, "gpencil_strokes", true); + /* Extrude + Move = Interactively add new points */ + ot = WM_operatortype_append_macro("GPENCIL_OT_extrude_move", "Extrude Stroke Points", + "Extrude selected points and move them", + OPTYPE_UNDO | OPTYPE_REGISTER); + WM_operatortype_macro_define(ot, "GPENCIL_OT_extrude"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_boolean_set(otmacro->ptr, "gpencil_strokes", true); } /* ****************************************** */ |