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/space_view3d | |
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/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_gizmo_ruler.c | 13 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 3 |
3 files changed, 15 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index a8514967748..8c884783913 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1215,6 +1215,9 @@ void ED_view3d_buttons_region_layout_ex(const bContext *C, case CTX_MODE_WEIGHT_GPENCIL: ARRAY_SET_ITEMS(contexts, ".greasepencil_weight"); break; + case CTX_MODE_VERTEX_GPENCIL: + ARRAY_SET_ITEMS(contexts, ".greasepencil_vertex"); + break; default: break; } @@ -1232,6 +1235,9 @@ void ED_view3d_buttons_region_layout_ex(const bContext *C, case CTX_MODE_EDIT_GPENCIL: ARRAY_SET_ITEMS(contexts, ".greasepencil_edit"); break; + case CTX_MODE_VERTEX_GPENCIL: + ARRAY_SET_ITEMS(contexts, ".greasepencil_vertex"); + break; default: break; } diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c index 6fbae1d8cb1..83539900f36 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c @@ -409,7 +409,7 @@ static bool view3d_ruler_item_mousemove(struct Depsgraph *depsgraph, /* Helper: Find the layer created as ruler. */ static bGPDlayer *view3d_ruler_layer_get(bGPdata *gpd) { - for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { + LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { if (gpl->flag & GP_LAYER_IS_RULER) { return gpl; } @@ -445,7 +445,7 @@ static bool view3d_ruler_to_gpencil(bContext *C, wmGizmoGroup *gzgroup) gpl->flag |= GP_LAYER_HIDE | GP_LAYER_IS_RULER; } - gpf = BKE_gpencil_layer_getframe(gpl, CFRA, GP_GETFRAME_ADD_NEW); + gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_ADD_NEW); BKE_gpencil_free_strokes(gpf); for (ruler_item = gzgroup->gizmos.first; ruler_item; @@ -477,9 +477,10 @@ static bool view3d_ruler_to_gpencil(bContext *C, wmGizmoGroup *gzgroup) } gps->flag = GP_STROKE_3DSPACE; gps->thickness = 3; - gps->gradient_f = 1.0f; - gps->gradient_s[0] = 1.0f; - gps->gradient_s[1] = 1.0f; + gps->hardeness = 1.0f; + gps->fill_opacity_fac = 1.0f; + copy_v2_fl(gps->aspect_ratio, 1.0f); + gps->uv_scale = 1.0f; BLI_addtail(&gpf->strokes, gps); changed = true; @@ -498,7 +499,7 @@ static bool view3d_ruler_from_gpencil(const bContext *C, wmGizmoGroup *gzgroup) gpl = view3d_ruler_layer_get(scene->gpd); if (gpl) { bGPDframe *gpf; - gpf = BKE_gpencil_layer_getframe(gpl, CFRA, GP_GETFRAME_USE_PREV); + gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV); if (gpf) { bGPDstroke *gps; for (gps = gpf->strokes.first; gps; gps = gps->next) { diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 7649bd45a1a..bd92193206f 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -2265,7 +2265,8 @@ static bool ed_object_select_pick(bContext *C, if (ELEM(basact->object->mode, OB_MODE_PAINT_GPENCIL, OB_MODE_SCULPT_GPENCIL, - OB_MODE_WEIGHT_GPENCIL)) { + OB_MODE_WEIGHT_GPENCIL, + OB_MODE_VERTEX_GPENCIL)) { ED_gpencil_toggle_brush_cursor(C, true, NULL); } else { |