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:
authorAntonioya <blendergit@gmail.com>2019-03-04 19:05:44 +0300
committerAntonioya <blendergit@gmail.com>2019-03-04 19:06:03 +0300
commitf6bafef1e1a84ce5b5fcdbc1e53e3341d4433f3b (patch)
treeef6ee5c6a365153d0dfadfa09795382ecb7aae65 /source/blender/draw/engines/gpencil/gpencil_draw_utils.c
parentb27ada979ce3b41d0e44fabf354df3d572ea2cfa (diff)
GPencil: Move Object Depth Order to Object
There was a conflict between Object "In Front" and how the strokes were managed in Stroke panel for grease pencil datablock. In order to keep consistency, the order of the object has been moved to Object level and now it's using the standard "In Front" flag. As all it is 3D, the option "Back" has been removed. This also fixes the problem with task T62137. Also related to commit 54ffc4e19dc4 and D4405
Diffstat (limited to 'source/blender/draw/engines/gpencil/gpencil_draw_utils.c')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_utils.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 1b406f298cd..e77f570b7bd 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -416,7 +416,8 @@ static DRWShadingGroup *DRW_gpencil_shgroup_fill_create(
stl->shgroups[id].texture_flip = gp_style->flag & GP_STYLE_COLOR_FLIP_FILL ? 1 : 0;
DRW_shgroup_uniform_int(grp, "texture_flip", &stl->shgroups[id].texture_flip, 1);
- DRW_shgroup_uniform_int(grp, "xraymode", (const int *) &gpd->xray_mode, 1);
+ stl->shgroups[id].xray_mode = (ob->dtx & OB_DRAWXRAY) ? GP_XRAY_FRONT : GP_XRAY_3DSPACE;
+ DRW_shgroup_uniform_int(grp, "xraymode", &stl->shgroups[id].xray_mode, 1);
DRW_shgroup_uniform_int(grp, "drawmode", (const int *) &gpd->draw_mode, 1);
/* viewport x-ray */
@@ -570,7 +571,8 @@ DRWShadingGroup *DRW_gpencil_shgroup_stroke_create(
}
if ((gpd) && (id > -1)) {
- DRW_shgroup_uniform_int(grp, "xraymode", (const int *) &gpd->xray_mode, 1);
+ stl->shgroups[id].xray_mode = (ob->dtx & OB_DRAWXRAY) ? GP_XRAY_FRONT : GP_XRAY_3DSPACE;
+ DRW_shgroup_uniform_int(grp, "xraymode", &stl->shgroups[id].xray_mode, 1);
}
else {
/* for drawing always on predefined z-depth */
@@ -689,7 +691,8 @@ static DRWShadingGroup *DRW_gpencil_shgroup_point_create(
}
if (gpd) {
- DRW_shgroup_uniform_int(grp, "xraymode", (const int *)&gpd->xray_mode, 1);
+ stl->shgroups[id].xray_mode = (ob->dtx & OB_DRAWXRAY) ? GP_XRAY_FRONT : GP_XRAY_3DSPACE;
+ DRW_shgroup_uniform_int(grp, "xraymode", (const int *)&stl->shgroups[id].xray_mode, 1);
}
else {
/* for drawing always on on predefined z-depth */
@@ -1495,7 +1498,7 @@ static void DRW_gpencil_shgroups_create(
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl;
bGPdata *gpd = (bGPdata *)ob->data;
- DRWPass *stroke_pass = GPENCIL_3D_DRAWMODE(gpd) ? psl->stroke_pass_3d : psl->stroke_pass_2d;
+ DRWPass *stroke_pass = GPENCIL_3D_DRAWMODE(ob, gpd) ? psl->stroke_pass_3d : psl->stroke_pass_2d;
GpencilBatchGroup *elm = NULL;
DRWShadingGroup *shgrp = NULL;