Fix T85581: GPencil draw on surface does not work

The problem was the stroke was reproject flat to view if the axis was View. Now, if the operation is using depth, the stroke is not reprojected.

Related to T85082
This commit is contained in:
Antonio Vazquez 2021-02-12 15:23:47 +01:00
parent 9febda912b
commit 72989f9d0b
3 changed files with 4 additions and 4 deletions

@ -1285,7 +1285,7 @@ static void gpencil_stroke_from_buffer(tGPDfill *tgpf)
}
/* If camera view or view projection, reproject flat to view to avoid perspective effect. */
if (((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera) {
if ((!is_depth) && ((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera) {
ED_gpencil_project_stroke_to_view(tgpf->C, tgpf->gpl, gps);
}

@ -1085,7 +1085,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
}
/* If camera view or view projection, reproject flat to view to avoid perspective effect. */
if (((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera) {
if ((!is_depth) && ((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera) {
ED_gpencil_project_stroke_to_view(p->C, p->gpl, gps);
}
}
@ -1234,7 +1234,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
/* change position relative to parent object */
gpencil_apply_parent(depsgraph, obact, gpl, gps);
/* If camera view or view projection, reproject flat to view to avoid perspective effect. */
if (((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera) {
if ((!is_depth) && ((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera) {
ED_gpencil_project_stroke_to_view(p->C, p->gpl, gps);
}

@ -1078,7 +1078,7 @@ static void gpencil_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
}
/* If camera view or view projection, reproject flat to view to avoid perspective effect. */
if (((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera) {
if ((!is_depth) && ((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera) {
ED_gpencil_project_stroke_to_view(C, tgpi->gpl, gps);
}