diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2009-09-08 15:14:36 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2009-09-08 15:14:36 +0400 |
commit | 31fec003a1ff611433992c4c7ebc03867afb8d0b (patch) | |
tree | 2aa3454672976c1cb3d5f7ba05f06fb25a99e673 /source | |
parent | 5ce8b1f70476626aae9a5a818398cf9e55a679af (diff) |
Fix row/column order in matrix printout function.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/generic/matrix.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index 37d06d0b531..edb6fb7af63 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -598,18 +598,18 @@ static PyObject *Matrix_repr(MatrixObject * self) return NULL; BLI_strncpy(str,"",1024); - for(x = 0; x < self->rowSize; x++){ + for(x = 0; x < self->colSize; x++){ sprintf(buffer, "["); strcat(str,buffer); - for(y = 0; y < (self->colSize - 1); y++) { - sprintf(buffer, "%.6f, ", self->matrix[x][y]); + for(y = 0; y < (self->rowSize - 1); y++) { + sprintf(buffer, "%.6f, ", self->matrix[y][x]); strcat(str,buffer); } - if(x < (self->rowSize-1)){ - sprintf(buffer, "%.6f](matrix [row %d])\n", self->matrix[x][y], x); + if(x < (self->colSize-1)){ + sprintf(buffer, "%.6f](matrix [row %d])\n", self->matrix[y][x], x); strcat(str,buffer); }else{ - sprintf(buffer, "%.6f](matrix [row %d])", self->matrix[x][y], x); + sprintf(buffer, "%.6f](matrix [row %d])", self->matrix[y][x], x); strcat(str,buffer); } } @@ -703,7 +703,7 @@ static int Matrix_ass_item(MatrixObject * self, int i, PyObject * ob) return -1; if(i >= self->rowSize || i < 0){ - PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: bad row\n"); + PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: bad column\n"); return -1; } |