[Bf-blender-cvs] [d7a9d0d9c37] greasepencil-object: Revert "GPencil: Object mode always use Vertex Paint mix"
Antonio Vazquez
noreply at git.blender.org
Sat Nov 30 16:21:28 CET 2019
Commit: d7a9d0d9c3749dbceb79139c3f8fe09ddbf60f44
Author: Antonio Vazquez
Date: Sat Nov 30 13:47:45 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBd7a9d0d9c3749dbceb79139c3f8fe09ddbf60f44
Revert "GPencil: Object mode always use Vertex Paint mix"
This reverts commit 578db1e1a63dcf84df3c210fbd3f9a95298b08eb.
===================================================================
M source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M source/blender/draw/engines/gpencil/gpencil_engine.h
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index bdd85d85f70..0826a52cbee 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -160,7 +160,7 @@ void gpencil_get_point_geom(GpencilBatchCacheElem *be,
int totvertex = gps->totpoints;
float mix_color[4];
- const float vpaint_mix = gpencil_get_vertex_paint_factor(ob, v3d);
+ const float vpaint_mix = gpencil_get_vertex_paint_factor(v3d);
const bool attenuate = (GPENCIL_VERTEX_MODE(gpd) &&
GPENCIL_ANY_VERTEX_MASK(ts->gpencil_selectmode_vertex));
@@ -272,7 +272,7 @@ void gpencil_get_stroke_geom(struct GpencilBatchCacheElem *be,
Object *ob = draw_ctx->obact;
bGPdata *gpd = ob ? (bGPdata *)ob->data : NULL;
- const float vpaint_mix = gpencil_get_vertex_paint_factor(ob, v3d);
+ const float vpaint_mix = gpencil_get_vertex_paint_factor(v3d);
const bool attenuate = (GPENCIL_VERTEX_MODE(gpd) &&
GPENCIL_ANY_VERTEX_MASK(ts->gpencil_selectmode_vertex));
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 912e9f7a3d3..5ecd0342d4d 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -972,19 +972,13 @@ static DRWShadingGroup *gpencil_shgroup_point_create(GPENCIL_e_data *e_data,
}
/* Get vertex Paint factor */
-float gpencil_get_vertex_paint_factor(Object *ob, View3D *v3d)
+float gpencil_get_vertex_paint_factor(View3D *v3d)
{
if (v3d) {
- /* If Object mode always use Vertex Paint mix. */
- if ((ob) && (ob->mode == OB_MODE_OBJECT)) {
- return 1.0f;
- }
-
float vpaint_mix = ((v3d->shading.type < OB_MATERIAL) &&
(v3d->shading.color_type == V3D_SHADING_MATERIAL_COLOR)) ?
0.0f :
v3d->overlay.gpencil_vertex_paint_opacity;
-
return vpaint_mix;
}
@@ -1007,7 +1001,7 @@ static void gpencil_add_fill_vertexdata(GpencilBatchCache *cache,
View3D *v3d = draw_ctx->v3d;
bGPdata *gpd = ob ? (bGPdata *)ob->data : NULL;
- const float vpaint_mix = gpencil_get_vertex_paint_factor(ob, v3d);
+ const float vpaint_mix = gpencil_get_vertex_paint_factor(v3d);
const bool attenuate = (GPENCIL_VERTEX_MODE(gpd) &&
GPENCIL_ANY_VERTEX_MASK(ts->gpencil_selectmode_vertex));
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index b65ca121339..e3714d6627a 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -465,7 +465,7 @@ struct tGPencilObjectCache *gpencil_object_cache_add(struct tGPencilObjectCache
int *gp_cache_used);
bool gpencil_onion_active(struct bGPdata *gpd);
-float gpencil_get_vertex_paint_factor(struct Object *ob, struct View3D *v3d);
+float gpencil_get_vertex_paint_factor(struct View3D *v3d);
/* shading groups cache functions */
struct GpencilBatchGroup *gpencil_group_cache_add(struct GpencilBatchGroup *cache_array,
More information about the Bf-blender-cvs
mailing list