Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Selten <michel@mselten.demon.nl>2003-07-07 00:34:59 +0400
committerMichel Selten <michel@mselten.demon.nl>2003-07-07 00:34:59 +0400
commit828347f698740f318a2d3438cc573e378a3431aa (patch)
treed78ad643f7c621c4cb4ce4782034449955d7a7d6
parenta4cc2526b38dbc47d86ed37aa3f836b9e1a054fe (diff)
* removed some debugging prints. Accidentally committed them last time.
* nicely format the matrix object when printing.
-rw-r--r--source/blender/python/api2_2x/Object.c11
-rw-r--r--source/blender/python/api2_2x/gen_utils.c9
-rw-r--r--source/blender/python/api2_2x/vector.c7
3 files changed, 9 insertions, 18 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c
index e893d1ccf51..a9910c7a39b 100644
--- a/source/blender/python/api2_2x/Object.c
+++ b/source/blender/python/api2_2x/Object.c
@@ -701,17 +701,8 @@ static PyObject *Object_getInverseMatrix (BPy_Object *self)
Object * ob;
ob = self->object;
- printf ("----Before inverse----\n");
- printf ("%f, %f, %f, %f\n", ob->obmat[0][0], ob->obmat[0][1], ob->obmat[0][2], ob->obmat[0][3]);
- printf ("%f, %f, %f, %f\n", ob->obmat[1][0], ob->obmat[1][1], ob->obmat[1][2], ob->obmat[1][3]);
- printf ("%f, %f, %f, %f\n", ob->obmat[2][0], ob->obmat[2][1], ob->obmat[2][2], ob->obmat[2][3]);
- printf ("%f, %f, %f, %f\n", ob->obmat[3][0], ob->obmat[3][1], ob->obmat[3][2], ob->obmat[3][3]);
+
Mat4Invert (inverse, self->object->obmat);
- printf ("-----After inverse-----\n");
- printf ("%f, %f, %f, %f\n", inverse[0][0], inverse[0][1], inverse[0][2], inverse[0][3]);
- printf ("%f, %f, %f, %f\n", inverse[1][0], inverse[1][1], inverse[1][2], inverse[1][3]);
- printf ("%f, %f, %f, %f\n", inverse[2][0], inverse[2][1], inverse[2][2], inverse[2][3]);
- printf ("%f, %f, %f, %f\n", inverse[3][0], inverse[3][1], inverse[3][2], inverse[3][3]);
return (newMatrixObject (inverse));
}
diff --git a/source/blender/python/api2_2x/gen_utils.c b/source/blender/python/api2_2x/gen_utils.c
index 804acfb7002..bfed33fb20e 100644
--- a/source/blender/python/api2_2x/gen_utils.c
+++ b/source/blender/python/api2_2x/gen_utils.c
@@ -191,30 +191,25 @@ int EXPP_check_sequence_consistency(PyObject *seq, PyTypeObject *against)
PyObject *EXPP_tuple_repr(PyObject *self, int size)
{
- PyObject *repr, *comma, *item;
+ PyObject *repr, *item;
int i;
/*@ note: a value must be built because the list is decrefed!
* otherwise we have nirvana pointers inside python.. */
- repr = PyString_FromString("(");
+ repr = PyString_FromString("");
if (!repr) return 0;
item = PySequence_GetItem(self, 0);
PyString_ConcatAndDel(&repr, PyObject_Repr(item));
Py_DECREF(item);
- comma = PyString_FromString(", ");
-
for (i = 1; i < size; i++) {
- PyString_Concat(&repr, comma);
item = PySequence_GetItem(self, i);
PyString_ConcatAndDel(&repr, PyObject_Repr(item));
Py_DECREF(item);
}
- PyString_ConcatAndDel(&repr, PyString_FromString(")"));
- Py_DECREF(comma);
return repr;
diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c
index 69b32716a2c..9cdeed2b30e 100644
--- a/source/blender/python/api2_2x/vector.c
+++ b/source/blender/python/api2_2x/vector.c
@@ -146,7 +146,12 @@ static int Vector_ass_slice(VectorObject *self, int begin, int end, PyObject *se
static PyObject *Vector_repr (VectorObject *self)
{
- return EXPP_tuple_repr((PyObject *) self, self->size);
+ char buffer[100];
+
+ sprintf (buffer, "[%.3f, %.3f, %.3f, %.3f]\n",
+ self->vec[0], self->vec[1], self->vec[2], self->vec[3]);
+
+ return PyString_FromString (buffer);
}
static PySequenceMethods Vector_SeqMethods =