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/transform | |
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/transform')
-rw-r--r-- | source/blender/editors/transform/transform_gizmo_extrude_3d.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_gizmo_extrude_3d.c b/source/blender/editors/transform/transform_gizmo_extrude_3d.c index b1ea7b87efb..81f4ec8c30a 100644 --- a/source/blender/editors/transform/transform_gizmo_extrude_3d.c +++ b/source/blender/editors/transform/transform_gizmo_extrude_3d.c @@ -147,7 +147,13 @@ static void gizmo_mesh_extrude_setup(const bContext *C, wmGizmoGroup *gzgroup) { const Object *obedit = CTX_data_edit_object(C); const char *op_idname = NULL; - if (obedit->type == OB_MESH) { + /* grease pencil does not use obedit */ + /* GPXX: Remove if OB_MODE_EDIT_GPENCIL is merged with OB_MODE_EDIT */ + const Object *ob = CTX_data_active_object(C); + if ((ob) && (ob->type == OB_GPENCIL)) { + op_idname = "GPENCIL_OT_extrude_move"; + } + else if (obedit->type == OB_MESH) { op_idname = "MESH_OT_extrude_context_move"; ggd->normal_axis = 2; } |