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-03-07 03:26:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-07 03:41:33 +0300
commita3d647558e2234ee3c7acb338ed51e432d9ca92a (patch)
tree9497169f3928831827c96a32bce86585256ab6cb /source/blender/blenkernel/intern/object.c
parente1a62fa1a61167990c4ade74b9e8b56573e18d2d (diff)
DRW: show image empty frame when the 'side' is hidden
This behavior matches back-face culled mesh objects, where the wire outline doesn't depend on the viewing angle. Applying this before empty visibility check for view framing, since it's strange if viewing all gives different results depending on back-face culling.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index ca82353a16a..1743060aa97 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2849,9 +2849,23 @@ void BKE_object_empty_draw_type_set(Object *ob, const int value)
}
}
-bool BKE_object_empty_image_is_visible_in_view3d(const Object *ob, const RegionView3D *rv3d)
+bool BKE_object_empty_image_frame_is_visible_in_view3d(const Object *ob, const RegionView3D *rv3d)
{
- char visibility_flag = ob->empty_image_visibility_flag;
+ const char visibility_flag = ob->empty_image_visibility_flag;
+ if (rv3d->is_persp) {
+ return (visibility_flag & OB_EMPTY_IMAGE_HIDE_PERSPECTIVE) == 0;
+ }
+ else {
+ return (visibility_flag & OB_EMPTY_IMAGE_HIDE_ORTHOGRAPHIC) == 0;
+ }
+}
+
+bool BKE_object_empty_image_data_is_visible_in_view3d(const Object *ob, const RegionView3D *rv3d)
+{
+ /* Caller is expected to check this. */
+ BLI_assert(BKE_object_empty_image_frame_is_visible_in_view3d(ob, rv3d));
+
+ const char visibility_flag = ob->empty_image_visibility_flag;
if ((visibility_flag & (OB_EMPTY_IMAGE_HIDE_BACK | OB_EMPTY_IMAGE_HIDE_FRONT)) != 0) {
float eps, dot;
@@ -2880,12 +2894,7 @@ bool BKE_object_empty_image_is_visible_in_view3d(const Object *ob, const RegionV
}
}
- if (rv3d->is_persp) {
- return (visibility_flag & OB_EMPTY_IMAGE_HIDE_PERSPECTIVE) == 0;
- }
- else {
- return (visibility_flag & OB_EMPTY_IMAGE_HIDE_ORTHOGRAPHIC) == 0;
- }
+ return true;
}
bool BKE_object_minmax_dupli(Depsgraph *depsgraph, Scene *scene, Object *ob, float r_min[3], float r_max[3], const bool use_hidden)