diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-10-26 13:40:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-10-26 14:02:40 +0300 |
commit | ef96f36ee961e7f11556570da2b9cef0a08159f9 (patch) | |
tree | 2a6943daee3d11baa7f3a92a58eff72d48ea3609 /source/blender/draw | |
parent | 654ee398ff0e37f4d5f5c4df96b1d521e4796de4 (diff) |
Move background images into the camera
This moves background images out of the 3D viewport,
to be used only as camera reference images.
For 3D viewport references,
background images can be used, see: D2827
Some work is still needed
(background option isn't working at the moment).
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 2a3d9fafd2a..b1721247568 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -3274,6 +3274,25 @@ void DRW_draw_render_loop_ex( DRW_state_reset(); DRW_engines_draw_background(); + /* WIP, single image drawn over the camera view (replace) */ + bool do_bg_image = false; + if (rv3d->persp == RV3D_CAMOB) { + Object *cam_ob = v3d->camera; + if (cam_ob && cam_ob->type == OB_CAMERA) { + Camera *cam = cam_ob->data; + if (!BLI_listbase_is_empty(&cam->bg_images)) { + do_bg_image = true; + } + } + } + + extern void view3d_draw_bgpic_test(Scene *scene, ARegion *ar, View3D *v3d, + const bool do_foreground, const bool do_camera_frame); + if (do_bg_image) { + view3d_draw_bgpic_test(scene, ar, v3d, false, true); + } + + DRW_draw_callbacks_pre_scene(); if (DST.draw_ctx.evil_C) { ED_region_draw_cb_draw(DST.draw_ctx.evil_C, DST.draw_ctx.ar, REGION_DRAW_PRE_VIEW); @@ -3301,6 +3320,10 @@ void DRW_draw_render_loop_ex( DRW_stats_reset(); + if (do_bg_image) { + view3d_draw_bgpic_test(scene, ar, v3d, true, true); + } + if (G.debug_value > 20) { DRW_debug_cpu_stats(); DRW_debug_gpu_stats(); |