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-02-26 18:55:21 +0300
committerAntonioya <blendergit@gmail.com>2019-02-26 19:09:29 +0300
commit2b3553eff2a01cf3d1655183de9ebd416abde9c1 (patch)
tree07f33093a160df8a88c283528945150a951bf589 /source/blender/draw/engines/gpencil/gpencil_cache_utils.c
parent65de468396aaf5f43fffdc6d42e304412f75fcb8 (diff)
GP: Redesign wireframe mode
Now it's possible use the different Wire modes (Single, Object & Random) Also support for x-ray mode. For random colors, the name of the object and the name of the layer is used. Also some parameters cleanup.
Diffstat (limited to 'source/blender/draw/engines/gpencil/gpencil_cache_utils.c')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_cache_utils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index f6702f6f56b..c18aa27ea79 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -45,6 +45,7 @@ tGPencilObjectCache *gpencil_object_cache_add(
const DRWContextState *draw_ctx = DRW_context_state_get();
tGPencilObjectCache *cache_elem = NULL;
RegionView3D *rv3d = draw_ctx->rv3d;
+ View3D *v3d = draw_ctx->v3d;
tGPencilObjectCache *p = NULL;
/* By default a cache is created with one block with a predefined number of free slots,
@@ -79,6 +80,16 @@ tGPencilObjectCache *gpencil_object_cache_add(
cache_elem->pixfactor = cache_elem->gpd->pixfactor;
cache_elem->shader_fx = ob->shader_fx;
+ /* save wire mode (object mode is always primary option) */
+ if (ob->dt == OB_WIRE) {
+ cache_elem->shading_type = (int)OB_WIRE;
+ }
+ else {
+ if (v3d) {
+ cache_elem->shading_type = (int)v3d->shading.type;
+ }
+ }
+
/* shgrp array */
cache_elem->tot_layers = 0;
int totgpl = BLI_listbase_count(&cache_elem->gpd->layers);