Commit: 2e3edb6995d31c762382aa0ad6781807bac30377
Author: Philipp Oeser
Date:   Tue Apr 5 17:17:03 2022 +0200
Branches: master
https://developer.blender.org/rB2e3edb6995d31c762382aa0ad6781807bac30377

Fix Empty "Only Axis Aligned" viewing angle depends on object scale

This was projecting the unnormalized z scale axis onto the plane defined
by the view vector. If object scale was very small, this made the empty
still visible at viewing angles far from the object axis.

Now use the normalized z scale axis to make this work the same at all
object scales.

Fixes T97004.

Maniphest Tasks: T97004

Differential Revision: https://developer.blender.org/D14557

===================================================================

M       source/blender/blenkernel/intern/object.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/object.cc 
b/source/blender/blenkernel/intern/object.cc
index cc68337e570..bafdbb6bb7e 100644
--- a/source/blender/blenkernel/intern/object.cc
+++ b/source/blender/blenkernel/intern/object.cc
@@ -3974,8 +3974,9 @@ 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) {
-    float3 proj;
-    project_plane_v3_v3v3(proj, ob->obmat[2], rv3d->viewinv[2]);
+    float3 proj, ob_z_axis;
+    normalize_v3_v3(ob_z_axis, ob->obmat[2]);
+    project_plane_v3_v3v3(proj, ob_z_axis, rv3d->viewinv[2]);
     const float proj_length_sq = len_squared_v3(proj);
     if (proj_length_sq > 1e-5f) {
       return false;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to