[Bf-blender-cvs] [775df5a1d53] soc-2018-npr: Fix directional object matrix error

Nick Wu noreply at git.blender.org
Tue Aug 28 12:11:48 CEST 2018


Commit: 775df5a1d53e915d8c5cea4f52d7f86881c4f93c
Author: Nick Wu
Date:   Tue Aug 28 18:10:18 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rB775df5a1d53e915d8c5cea4f52d7f86881c4f93c

Fix directional object matrix error

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

M	source/blender/draw/engines/lanpr/lanpr_ops.c

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

diff --git a/source/blender/draw/engines/lanpr/lanpr_ops.c b/source/blender/draw/engines/lanpr/lanpr_ops.c
index 3e359ea8667..68166cfeeaa 100644
--- a/source/blender/draw/engines/lanpr/lanpr_ops.c
+++ b/source/blender/draw/engines/lanpr/lanpr_ops.c
@@ -3040,7 +3040,10 @@ void lanpr_calculate_normal_object_vector(LANPR_LineLayer* ll, float* normal_obj
 			normal_object_direction[2] = 1; // default z up direction
 		}else {
 			float dir[3] = {0,0,1};
-			mul_v3_m3v3(normal_object_direction, ob->obmat, dir);
+			float mat[3][3];
+			copy_m3_m4(mat, ob->obmat);
+			mul_v3_m3v3(normal_object_direction, mat, dir);
+			normalize_v3(normal_object_direction);
 		}
 		return;
 	case LANPR_NORMAL_POINT:



More information about the Bf-blender-cvs mailing list