diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-03-09 18:27:24 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-03-09 18:27:24 +0300 |
commit | 29f3af95272590d26f610ae828b2eeee89c82a00 (patch) | |
tree | a696a58a2561c48f7ec6166e369e22081e0a64d8 /source/blender/editors/include/ED_gpencil.h | |
parent | dcb93126876879d969a30a7865700abd072066f8 (diff) |
GPencil: Refactor of Draw Engine, Vertex Paint and all internal functions
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes.
Also, a huge code cleanup has been done at all levels.
Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development.
Differential Revision: https://developer.blender.org/D6293
Diffstat (limited to 'source/blender/editors/include/ED_gpencil.h')
-rw-r--r-- | source/blender/editors/include/ED_gpencil.h | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index 8d2d9b934d4..8dd162ea538 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -39,6 +39,7 @@ struct bGPDspoint; struct bGPDstroke; struct bGPdata; struct tGPspoint; +struct GP_SpaceConversion; struct ARegion; struct Depsgraph; @@ -46,6 +47,7 @@ struct Main; struct RegionView3D; struct ReportList; struct Scene; +struct ToolSettings; struct ScrArea; struct View3D; struct ViewLayer; @@ -75,23 +77,8 @@ typedef struct tGPspoint { float uv_rot; /* uv rotation for dor mode */ float rnd[3]; /* rnd value */ bool rnd_dirty; /* rnd flag */ - short tflag; /* Internal flag */ } tGPspoint; -/* tGPspoint->flag */ -typedef enum etGPspoint_tFlag { - /* Created by Fake event (used when mouse/pen move very fast while drawing). */ - GP_TPOINT_FAKE = (1 << 0), -} etGPspoint_tFlag; - -/* used to sort by zdepth gpencil objects in viewport */ -/* TODO: this could be a system parameter in userprefs screen */ -#define GP_CACHE_BLOCK_SIZE 16 -typedef struct tGPencilSort { - struct Base *base; - float zdepth; -} tGPencilSort; - /* ----------- Grease Pencil Tools/Context ------------- */ /* Context-dependent */ @@ -210,12 +197,6 @@ bool ED_gpencil_add_lattice_modifier(const struct bContext *C, /* ------------ Transformation Utilities ------------ */ -/* get difference matrix */ -void ED_gpencil_parent_location(const struct Depsgraph *depsgraph, - struct Object *obact, - struct bGPdata *gpd, - struct bGPDlayer *gpl, - float diff_mat[4][4]); /* reset parent matrix for all layers */ void ED_gpencil_reset_layers_parent(struct Depsgraph *depsgraph, struct Object *obact, @@ -231,7 +212,6 @@ void ED_gpencil_create_stroke(struct bContext *C, struct Object *ob, float mat[4 /* ------------ Object Utilities ------------ */ struct Object *ED_gpencil_add_object(struct bContext *C, - struct Scene *scene, const float loc[3], unsigned short local_view_bits); void ED_gpencil_add_defaults(struct bContext *C, struct Object *ob); @@ -251,11 +231,11 @@ void ED_gp_project_point_to_plane(const struct Scene *scene, const float origin[3], const int axis, struct bGPDspoint *pt); -void ED_gp_get_drawing_reference(const struct Scene *scene, - const struct Object *ob, - struct bGPDlayer *gpl, - char align_flag, - float vec[3]); +void ED_gpencil_drawing_reference_get(const struct Scene *scene, + const struct Object *ob, + struct bGPDlayer *gpl, + char align_flag, + float vec[3]); void ED_gpencil_project_stroke_to_view(struct bContext *C, struct bGPDlayer *gpl, struct bGPDstroke *gps); @@ -277,7 +257,6 @@ void ED_gpencil_tpoint_to_point(struct ARegion *region, float origin[3], const struct tGPspoint *tpt, struct bGPDspoint *pt); -void ED_gpencil_calc_stroke_uv(struct Object *ob, struct bGPDstroke *gps); void ED_gpencil_update_color_uv(struct Main *bmain, struct Material *mat); /* extend selection to stroke intersections @@ -303,9 +282,30 @@ struct tGPspoint *ED_gpencil_sbuffer_ensure(struct tGPspoint *buffer_array, int *buffer_size, int *buffer_used, const bool clear); +void ED_gpencil_sbuffer_update_eval(struct bGPdata *gpd, struct Object *ob_eval); + /* Tag all scene grease pencil object to update. */ void ED_gpencil_tag_scene_gpencil(struct Scene *scene); +/* Vertex color set. */ +void ED_gpencil_fill_vertex_color_set(struct ToolSettings *ts, + struct Brush *brush, + struct bGPDstroke *gps); +void ED_gpencil_point_vertex_color_set(struct ToolSettings *ts, + struct Brush *brush, + struct bGPDspoint *pt); +void ED_gpencil_sbuffer_vertex_color_set(struct Depsgraph *depsgraph, + struct Object *ob, + struct ToolSettings *ts, + struct Brush *brush, + struct Material *material); + +bool ED_gpencil_stroke_check_collision(struct GP_SpaceConversion *gsc, + struct bGPDstroke *gps, + float mouse[2], + const int radius, + const float diff_mat[4][4]); + #ifdef __cplusplus } #endif |