[Bf-blender-cvs] [d4fc6923c46] pygpu_extensions: Fix T85581: GPencil draw on surface does not work

Antonio Vazquez noreply at git.blender.org
Fri Feb 12 16:17:21 CET 2021


Commit: d4fc6923c4683b7350a251c8dbbc2d7dc1f82b3c
Author: Antonio Vazquez
Date:   Fri Feb 12 15:23:47 2021 +0100
Branches: pygpu_extensions
https://developer.blender.org/rBd4fc6923c4683b7350a251c8dbbc2d7dc1f82b3c

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

===================================================================

M	source/blender/editors/gpencil/gpencil_fill.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_primitive.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 832191c8321..e68b7802532 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -1560,7 +1560,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);
   }
 
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index b833125cf34..126de952e99 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1087,7 +1087,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);
     }
   }
@@ -1236,7 +1236,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);
     }
 
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index bcdde49b93d..89c6b1dcc75 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -1082,7 +1082,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);
   }



More information about the Bf-blender-cvs mailing list