[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23061] branches/blender2.5/blender/source /blender/python/generic/matrix.c: Fix row/ column order in matrix printout function.

Benoit Bolsee benoit.bolsee at online.be
Tue Sep 8 13:14:38 CEST 2009


Revision: 23061
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23061
Author:   ben2610
Date:     2009-09-08 13:14:36 +0200 (Tue, 08 Sep 2009)

Log Message:
-----------
Fix row/column order in matrix printout function.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/python/generic/matrix.c

Modified: branches/blender2.5/blender/source/blender/python/generic/matrix.c
===================================================================
--- branches/blender2.5/blender/source/blender/python/generic/matrix.c	2009-09-08 09:41:15 UTC (rev 23060)
+++ branches/blender2.5/blender/source/blender/python/generic/matrix.c	2009-09-08 11:14:36 UTC (rev 23061)
@@ -598,18 +598,18 @@
 		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 @@
 		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;
 	}
 





More information about the Bf-blender-cvs mailing list