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:
authorCampbell Barton <ideasman42@gmail.com>2019-09-03 11:55:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-09-03 12:01:27 +0300
commitabfb8b6963f4fcf02108e81f17b9de3fbef99dce (patch)
treeb20fa2b489e22a695ceb0ee2640cc1ee5797ea12 /source/blender/blenkernel/intern/object.c
parent8a7a7af627b89e67b12f9bc4ae9e175c397961ba (diff)
3D View: option only to show axis aligned image empties
Useful for using reference images that only make sense to see in aligned axis-views. This restores functionality possible with 2.7x background images. See: T52668.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 7ea395e9386..ed517bfc513 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2985,6 +2985,15 @@ bool BKE_object_empty_image_data_is_visible_in_view3d(const Object *ob, const Re
}
}
+ if (visibility_flag & OB_EMPTY_IMAGE_HIDE_NON_AXIS_ALIGNED) {
+ float proj[3];
+ project_plane_v3_v3v3(proj, ob->obmat[2], rv3d->viewinv[2]);
+ const float proj_length_sq = len_squared_v3(proj);
+ if (proj_length_sq > 1e-5f) {
+ return false;
+ }
+ }
+
return true;
}