diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2003-09-03 08:13:08 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2003-09-03 08:13:08 +0400 |
commit | a09e5a7f2f3ae81f504106eeb62373bb99b39b51 (patch) | |
tree | 838de24f316bcf1a5a1d15d057338ef8cf2d7108 /source/blender/python/api2_2x/vector.c | |
parent | 65746ab10a1031e4a1275c21051bce0064be5219 (diff) |
Exppython:
- Window: added .GetCursorPos()
- Lamp: updated for NoDiffuse and NoSpecular modes
- Registry: new module to handle persistent data
- vector: made it correctly print only 3 values when vec->size==3:
Fixes nmvert coords printed with a 4th 0.0 coordinate
- Text: fixed crash on startup (Python 2.3, linux):
added definition of the Text pyobject earlier, in Types.c
Diffstat (limited to 'source/blender/python/api2_2x/vector.c')
-rw-r--r-- | source/blender/python/api2_2x/vector.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c index 9cdeed2b30e..1bc8d817cbc 100644 --- a/source/blender/python/api2_2x/vector.c +++ b/source/blender/python/api2_2x/vector.c @@ -148,7 +148,11 @@ static PyObject *Vector_repr (VectorObject *self) { char buffer[100]; - sprintf (buffer, "[%.3f, %.3f, %.3f, %.3f]\n", + if (self->size == 3) + sprintf (buffer, "[%.3f, %.3f, %.3f]\n", + self->vec[0], self->vec[1], self->vec[2]); + else /* assuming size == 4 */ + sprintf (buffer, "[%.3f, %.3f, %.3f, %.3f]\n", self->vec[0], self->vec[1], self->vec[2], self->vec[3]); return PyString_FromString (buffer); |