GPencil: Keep original stroke when reproject

When reproject a stroke sometimes is good to keep the copy of the original stroke to create volume effects

Related to T77639

{F8603513}

Reviewed By: mendio, pepeland

Maniphest Tasks: T77639

Differential Revision: https://developer.blender.org/D7963
50258
This commit is contained in:
2020-06-09 15:41:26 +02:00
parent c23b1de2cf
commit 37d68871b7
3 changed files with 170 additions and 124 deletions

View File

@@ -64,6 +64,22 @@ struct bAnimContext;
struct wmKeyConfig;
struct wmOperator;
/* Reproject stroke modes. */
typedef enum eGP_ReprojectModes {
/* Axis */
GP_REPROJECT_FRONT = 0,
GP_REPROJECT_SIDE,
GP_REPROJECT_TOP,
/* On same plane, parallel to view-plane. */
GP_REPROJECT_VIEW,
/* Reprojected on to the scene geometry */
GP_REPROJECT_SURFACE,
/* Reprojected on 3D cursor orientation */
GP_REPROJECT_CURSOR,
/* Keep equals (used in some operators) */
GP_REPROJECT_KEEP,
} eGP_ReprojectModes;
/* ------------- Grease-Pencil Runtime Data ---------------- */
/* Temporary 'Stroke Point' data (2D / screen-space)
@@ -246,6 +262,15 @@ void ED_gpencil_project_stroke_to_view(struct bContext *C,
struct bGPDlayer *gpl,
struct bGPDstroke *gps);
void ED_gpencil_stroke_reproject(struct Depsgraph *depsgraph,
const struct GP_SpaceConversion *gsc,
struct SnapObjectContext *sctx,
struct bGPDlayer *gpl,
struct bGPDframe *gpf,
struct bGPDstroke *gps,
const eGP_ReprojectModes mode,
const bool keep_original);
/* set sculpt cursor */
void ED_gpencil_toggle_brush_cursor(struct bContext *C, bool enable, void *customdata);