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:
authorAntonioya <blendergit@gmail.com>2018-12-15 19:21:47 +0300
committerAntonioya <blendergit@gmail.com>2018-12-15 19:21:47 +0300
commit351f537fa832c50971454af304a071c096427e71 (patch)
tree3746ee812d1104dd6cdc13549ea80ee7e16b00dc /source/blender/editors/gpencil/gpencil_intern.h
parentf9917a8d431f5480d9a5d58dfcf84863911f3bf2 (diff)
GP: New Curve primitive and other primitive improvements
This commit adds support for new curve tool and adds more functionalities to the existing primitives, including new handles, editing, stroke thickness curve, noise, preview of the real stroke, etc. Thanks to @charlie for his great contribution to this improvement.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_intern.h')
-rw-r--r--source/blender/editors/gpencil/gpencil_intern.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index 2a92185cdd5..e2cbeda2733 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -138,6 +138,7 @@ typedef struct tGPDinterpolate {
/* Temporary primitive operation data */
typedef struct tGPDprimitive {
+ struct Main *bmain; /* main database pointer */
struct Depsgraph *depsgraph;
struct wmWindow *win; /* window where painting originated */
struct Scene *scene; /* current scene from context */
@@ -154,25 +155,34 @@ typedef struct tGPDprimitive {
struct bGPDlayer *gpl; /* layer */
struct bGPDframe *gpf; /* frame */
int type; /* type of primitive */
- short cyclic; /* cyclic option */
- short flip; /* flip option */
+ int orign_type; /* original type of primitive */
+ bool curve; /* type of primitive is a curve */
+ short flip; /* flip option */
+ tGPspoint *points; /* array of data-points for stroke */
+ int point_count; /* number of edges allocated */
+ int tot_stored_edges; /* stored number of polygon edges */
int tot_edges; /* number of polygon edges */
- int top[2]; /* first box corner */
- int bottom[2]; /* last box corner */
- int origin[2]; /* initial box corner */
+ float origin[2]; /* initial box corner */
+ float start[2]; /* first box corner */
+ float end[2]; /* last box corner */
+ float midpoint[2]; /* midpoint box corner */
+ float cp1[2]; /* first control point */
+ float cp2[2]; /* second control point */
+ int sel_cp; /* flag to determine control point is selected */
int flag; /* flag to determine operations in progress */
+ float mval[2]; /* recorded mouse-position */
+ float mvalo[2]; /* previous recorded mouse-position */
int lock_axis; /* lock to viewport axis */
+ struct RNG *rng;
NumInput num; /* numeric input */
- void *draw_handle_3d; /* handle for drawing strokes while operator is running 3d stuff */
} tGPDprimitive;
/* Modal Operator Drawing Callbacks ------------------------ */
void ED_gp_draw_interpolation(const struct bContext *C, struct tGPDinterpolate *tgpi, const int type);
-void ED_gp_draw_primitives(const struct bContext *C, struct tGPDprimitive *tgpi, const int type);
void ED_gp_draw_fill(struct tGPDdraw *tgpw);
/* ***************************************************** */
@@ -369,7 +379,8 @@ enum {
GP_STROKE_BOX = -1,
GP_STROKE_LINE = 1,
GP_STROKE_CIRCLE = 2,
- GP_STROKE_ARC = 3
+ GP_STROKE_ARC = 3,
+ GP_STROKE_CURVE = 4
};