diff options
Diffstat (limited to 'source/blender/editors/gpencil/annotate_paint.c')
-rw-r--r-- | source/blender/editors/gpencil/annotate_paint.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index e9817f82090..c155587e95a 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -660,10 +660,14 @@ static short annotation_stroke_addpoint(tGPsdata *p, View3D *v3d = p->area->spacedata.first; view3d_region_operator_needs_opengl(p->win, p->region); - ED_view3d_autodist_init(p->depsgraph, - p->region, - v3d, - (ts->annotate_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0); + ED_view3d_depth_override(p->depsgraph, + p->region, + v3d, + NULL, + (ts->annotate_v3d_align & GP_PROJECT_DEPTH_STROKE) ? + V3D_DEPTH_GPENCIL_ONLY : + V3D_DEPTH_NO_GPENCIL, + false); } /* convert screen-coordinates to appropriate coordinates (and store them) */ @@ -1222,7 +1226,7 @@ static void annotation_stroke_doeraser(tGPsdata *p) if (p->flags & GP_PAINTFLAG_V3D_ERASER_DEPTH) { View3D *v3d = p->area->spacedata.first; view3d_region_operator_needs_opengl(p->win, p->region); - ED_view3d_autodist_init(p->depsgraph, p->region, v3d, 0); + ED_view3d_depth_override(p->depsgraph, p->region, v3d, NULL, V3D_DEPTH_NO_GPENCIL, false); } } @@ -1544,7 +1548,7 @@ static void annotation_paint_initstroke(tGPsdata *p, if (p->gpl == NULL) { /* tag for annotations */ p->gpd->flag |= GP_DATA_ANNOTATIONS; - p->gpl = BKE_gpencil_layer_addnew(p->gpd, DATA_("Note"), true); + p->gpl = BKE_gpencil_layer_addnew(p->gpd, DATA_("Note"), true, false); if (p->custom_color[3]) { copy_v3_v3(p->gpl->color, p->custom_color); @@ -1695,8 +1699,14 @@ static void annotation_paint_strokeend(tGPsdata *p) /* need to restore the original projection settings before packing up */ view3d_region_operator_needs_opengl(p->win, p->region); - ED_view3d_autodist_init( - p->depsgraph, p->region, v3d, (ts->annotate_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0); + ED_view3d_depth_override(p->depsgraph, + p->region, + v3d, + NULL, + (ts->annotate_v3d_align & GP_PROJECT_DEPTH_STROKE) ? + V3D_DEPTH_GPENCIL_ONLY : + V3D_DEPTH_NO_GPENCIL, + false); } /* check if doing eraser or not */ |