[Bf-blender-cvs] [205b0d4651d] blender2.8: GP: Fix error drawing on Camera view for Surface/Stroke

Antonioya noreply at git.blender.org
Wed Dec 19 19:50:40 CET 2018


Commit: 205b0d4651d866c45442acf7066eff276245efa9
Author: Antonioya
Date:   Wed Dec 19 19:50:07 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB205b0d4651d866c45442acf7066eff276245efa9

GP: Fix error drawing on Camera view for Surface/Stroke

This bug was introduced fixing task T59595

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

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 0e1a5e613b2..e4e71339560 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -820,7 +820,10 @@ static void gpencil_stroke_from_buffer(tGPDfill *tgpf)
 	const int cfra_eval = (int)DEG_get_ctime(tgpf->depsgraph);
 
 	ToolSettings *ts = tgpf->scene->toolsettings;
-	const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) && (tgpf->rv3d->persp == RV3D_CAMOB);
+	const char *align_flag = &ts->gpencil_v3d_align;
+	const bool is_depth = (bool)(*align_flag & (GP_PROJECT_DEPTH_VIEW | GP_PROJECT_DEPTH_STROKE));
+	const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) &&
+		(tgpf->rv3d->persp == RV3D_CAMOB) && (!is_depth);
 	Brush *brush = BKE_paint_brush(&ts->gp_paint->paint);
 	if (brush == NULL) {
 		return;
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index ce15b2ba6b0..6e79afc747e 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -848,7 +848,10 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 	RegionView3D *rv3d = p->ar->regiondata;
 	const int def_nr = obact->actdef - 1;
 	const bool have_weight = (bool)BLI_findlink(&obact->defbase, def_nr);
-	const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) && (rv3d->persp == RV3D_CAMOB);
+	const char *align_flag = &ts->gpencil_v3d_align;
+	const bool is_depth = (bool)(*align_flag & (GP_PROJECT_DEPTH_VIEW | GP_PROJECT_DEPTH_STROKE));
+	const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) &&
+		(rv3d->persp == RV3D_CAMOB) && (!is_depth);
 	int i, totelem;
 
 	/* since strokes are so fine, when using their depth we need a margin otherwise they might get missed */
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index e1c3561ff76..efdcb263ec5 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -639,9 +639,10 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
 	bGPDstroke *gps = tgpi->gpf->strokes.first;
 	GP_Sculpt_Settings *gset = &ts->gp_sculpt;
 	int depth_margin = (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 4 : 0;
-	char *align_flag = &ts->gpencil_v3d_align;
+	const char *align_flag = &ts->gpencil_v3d_align;
 	bool is_depth = (bool)(*align_flag & (GP_PROJECT_DEPTH_VIEW | GP_PROJECT_DEPTH_STROKE));
-	const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) && (tgpi->rv3d->persp == RV3D_CAMOB);
+	const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) &&
+		(tgpi->rv3d->persp == RV3D_CAMOB) && (!is_depth);
 
 	if (tgpi->type == GP_STROKE_BOX)
 		gps->totpoints = (tgpi->tot_edges * 4 + tgpi->tot_stored_edges);



More information about the Bf-blender-cvs mailing list