diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-07-20 10:41:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-07-20 10:41:51 +0400 |
commit | 8b5e7f26501ba1794ad4e556fae169b2ca3c8769 (patch) | |
tree | 75b9963a3e5aa0d71d0e91d117aff5d358dda6b2 /source | |
parent | 60ae40a0ed320cef275c2fd05eed97bd125d9a6e (diff) |
patch [#28032] swapped matrix multiplication order, reverse it back, tested with FBX, BVH import/export which are very sensitive to changes in matrix rotation.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Matrix.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index 39d0784b287..a7ed63776a5 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -1587,7 +1587,7 @@ static PyObject *Matrix_mul(PyObject *m1, PyObject *m2) if(mat1 && mat2) { /*MATRIX * MATRIX*/ - if(mat1->row_size != mat2->col_size){ + if(mat2->row_size != mat1->col_size){ PyErr_SetString(PyExc_ValueError, "Matrix multiplication: " "matrix A rowsize must equal matrix B colsize"); @@ -1597,15 +1597,15 @@ static PyObject *Matrix_mul(PyObject *m1, PyObject *m2) float mat[16]= {0.0f}; int x, y, z; - for(x = 0; x < mat1->row_size; x++) { - for(y = 0; y < mat2->col_size; y++) { - for(z = 0; z < mat2->row_size; z++) { - mat[x * mat1->col_size + y] += (mat1->matrix[x][z] * mat2->matrix[z][y]); + for(x = 0; x < mat2->row_size; x++) { + for(y = 0; y < mat1->col_size; y++) { + for(z = 0; z < mat1->row_size; z++) { + mat[x * mat2->col_size + y] += (mat2->matrix[x][z] * mat1->matrix[z][y]); } } } - return newMatrixObject(mat, mat2->row_size, mat1->col_size, Py_NEW, Py_TYPE(mat1)); + return newMatrixObject(mat, mat1->row_size, mat2->col_size, Py_NEW, Py_TYPE(mat1)); } } else if(mat2) { |