Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-09-06 18:02:28 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-09-06 18:02:28 +0400
commit0c15f834e49b2e1c43c0e06f1fd8a7e7f5faa83f (patch)
treef7257e759f7245be35022de476ba7d9b1bd4413d /source/blender/editors/gpencil/gpencil_paint.c
parent47ffe63c86eb495aa5556939467692484aea8322 (diff)
Fix for poly line grease pencil and surface drawing.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_paint.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 460408c6269..a23f2064a9e 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -400,6 +400,15 @@ static short gp_stroke_addpoint (tGPsdata *p, const int mval[2], float pressure)
pts = &gps->points[gps->totpoints-1];
+ /* special case for poly lines: normally, depth is needed only when creating new stroke from buffer,
+ but poly lines are converting to stroke instantly, so initialize depth buffer before converting coordinates */
+ if (gpencil_project_check(p)) {
+ View3D *v3d= p->sa->spacedata.first;
+
+ view3d_region_operator_needs_opengl(p->win, p->ar);
+ ED_view3d_autodist_init(p->scene, p->ar, v3d, (p->gpd->flag & GP_DATA_DEPTH_STROKE) ? 1:0);
+ }
+
/* convert screen-coordinates to appropriate coordinates (and store them) */
gp_stroke_convertcoords(p, &pt->x, &pts->x, NULL);