diff options
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_engine.c | 6 | ||||
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_engine.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 0270b1a1d8c..1b511ea1f7f 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -91,6 +91,7 @@ void GPENCIL_engine_init(void *ved) stl->pd->gp_layer_pool = vldata->gp_layer_pool; stl->pd->gp_vfx_pool = vldata->gp_vfx_pool; stl->pd->scene = ctx->scene; + stl->pd->v3d = ctx->v3d; stl->pd->last_light_pool = NULL; stl->pd->last_material_pool = NULL; stl->pd->tobjects.first = NULL; @@ -905,6 +906,11 @@ void GPENCIL_draw_scene(void *ved) /* Fade 3D objects. */ if ((!pd->is_render) && (pd->fade_3d_object_opacity > -1.0f)) { + float background_color[3]; + ED_view3d_background_color_get(pd->scene, pd->v3d, background_color); + /* Blend color. */ + interp_v3_v3v3(clear_cols[0], background_color, clear_cols[0], pd->fade_3d_object_opacity); + mul_v4_fl(clear_cols[1], pd->fade_3d_object_opacity); } diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h index e7914a1b86c..f765dcf73de 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.h +++ b/source/blender/draw/engines/gpencil/gpencil_engine.h @@ -309,6 +309,8 @@ typedef struct GPENCIL_PrivateData { Object *camera; /* Copy of draw_ctx->scene for convenience. */ struct Scene *scene; + /* Copy of draw_ctx->vie3d for convenience. */ + struct View3D *v3d; /* Active object. */ Object *obact; |