[Bf-blender-cvs] [8054372] master: Fix negate_m3 (taking 4x4 matrix)

Campbell Barton noreply at git.blender.org
Thu Oct 30 10:29:27 CET 2014


Commit: 8054372d22310bad504012ca70a692ad9dc94973
Author: Campbell Barton
Date:   Thu Oct 30 10:26:22 2014 +0100
Branches: master
https://developer.blender.org/rB8054372d22310bad504012ca70a692ad9dc94973

Fix negate_m3 (taking 4x4 matrix)

Cycles bake used incorrectly.

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

M	source/blender/blenlib/BLI_math_matrix.h
M	source/blender/blenlib/intern/math_matrix.c
M	source/blender/editors/object/object_bake_api.c

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

diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h
index 732f4b6..e58e42f 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -125,7 +125,7 @@ void mul_m3_fl(float R[3][3], float f);
 void mul_m4_fl(float R[4][4], float f);
 void mul_mat3_m4_fl(float R[4][4], float f);
 
-void negate_m3(float R[4][4]);
+void negate_m3(float R[3][3]);
 void negate_m4(float R[4][4]);
 
 bool invert_m3_ex(float m[3][3], const float epsilon);
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index af42af8..6b40f0c 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -639,7 +639,7 @@ void mul_mat3_m4_fl(float m[4][4], float f)
 			m[i][j] *= f;
 }
 
-void negate_m3(float m[4][4])
+void negate_m3(float m[3][3])
 {
 	int i, j;
 
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 5746f9e..4821ffd 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -768,7 +768,7 @@ static int bake(
 			normalize_m4_m4(highpoly[i].rotmat, highpoly[i].imat);
 			zero_v3(highpoly[i].rotmat[3]);
 			if (is_negative_m4(highpoly[i].rotmat))
-				negate_m3(highpoly[i].rotmat);
+				negate_m4(highpoly[i].rotmat);
 
 			i++;
 		}




More information about the Bf-blender-cvs mailing list