[Bf-blender-cvs] [a6eb1bbf575] greasepencil-object: GP: Add offset over surface
Antonioya
noreply at git.blender.org
Sun Dec 9 09:41:27 CET 2018
Commit: a6eb1bbf5753c8b77bf70bda6239160f74fc5ad1
Author: Antonioya
Date: Sun Dec 9 09:41:23 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBa6eb1bbf5753c8b77bf70bda6239160f74fc5ad1
GP: Add offset over surface
===================================================================
M source/blender/editors/gpencil/gpencil_primitive.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index 67d7d76d52f..58f744349ae 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -660,6 +660,11 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
gpd->runtime.sbuffer_size++;
/* convert screen-coordinates to 3D coordinates */
+ /* add small offset to keep stroke over the surface */
+ if ((depth_arr) && (gpd->zdepth_offset > 0.0f)) {
+ depth_arr[i] *= (1.0f - gpd->zdepth_offset);
+ }
+
gp_stroke_convertcoords_tpoint(
tgpi->scene, tgpi->ar, tgpi->ob, tgpi->gpl,
p2d, depth_arr ? depth_arr + i : NULL,
More information about the Bf-blender-cvs
mailing list