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/editors/space_image | |
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/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 4fab7b33dbe..dbefcf3d297 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -48,6 +48,7 @@ #include "BLT_translation.h" +#include "DNA_camera_types.h" #include "DNA_object_types.h" #include "DNA_node_types.h" #include "DNA_packedFile_types.h" @@ -1309,21 +1310,23 @@ static int image_open_exec(bContext *C, wmOperator *op) ED_space_image_set(sima, scene, obedit, ima); iuser = &sima->iuser; } - else if (sa->spacetype == SPACE_VIEW3D) { - View3D *v3d = sa->spacedata.first; - - for (BGpic *bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next) { - if (bgpic->ima == ima) { - iuser = &bgpic->iuser; - break; - } - } - } else { Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data; if (tex && tex->type == TEX_IMAGE) { iuser = &tex->iuser; } + + if (iuser == NULL) { + Camera *cam = CTX_data_pointer_get_type(C, "camera", &RNA_Camera).data; + if (cam) { + for (CameraBGImage *bgpic = cam->bg_images.first; bgpic; bgpic = bgpic->next) { + if (bgpic->ima == ima) { + iuser = &bgpic->iuser; + break; + } + } + } + } } /* initialize because of new image */ |