diff options
author | Antonioya <blendergit@gmail.com> | 2018-10-03 11:55:07 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-10-03 11:55:26 +0300 |
commit | 8d26705b3e4e780145d43cfde0c1a2c302c425e0 (patch) | |
tree | 9a8b5369b492f55cf6f16bdbb54238216d49ec60 /source/blender/editors/gpencil/gpencil_paint.c | |
parent | 2d21eb79ad48485bc7b3385d6df5c2c25fd88ee0 (diff) |
GP: Add z-depth offset parameter
This parameter allows to define the percentage of offset of a stroke when uses surface mode.
Before, this was a fixed value, but for some artists' purposes, it's good to have the option to change it.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_paint.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 7b2a106b5cc..85479de7a77 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -371,12 +371,9 @@ static void gp_stroke_convertcoords(tGPsdata *p, const int mval[2], float out[3] /* in 3d-space - pt->x/y/z are 3 side-by-side floats */ if (gpd->runtime.sbuffer_sflag & GP_STROKE_3DSPACE) { - /* add small offset to keep stroke over the surface. - * This could be a UI parameter, but the value is too sensitive for - * the user to use it and don't improve the result. - */ - if (depth) { - *depth *= 0.99998f; + /* add small offset to keep stroke over the surface */ + if ((depth) && (gpd->zdepth_offset > 0.0f)) { + *depth *= (1.0f - gpd->zdepth_offset); } if (gpencil_project_check(p) && (ED_view3d_autodist_simple(p->ar, mval, out, 0, depth))) { |