From e5be894a29fa1a44cd11da18dbd094e32bb54dfb Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Mon, 21 Aug 2006 14:36:11 +0000 Subject: [PATCH] ===Python API=== Bugfix: unary minus on a point object should not modify the original point data but return a new point. --- source/blender/python/api2_2x/point.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/blender/python/api2_2x/point.c b/source/blender/python/api2_2x/point.c index 56e1eae5904..cc6bd3a5342 100644 --- a/source/blender/python/api2_2x/point.c +++ b/source/blender/python/api2_2x/point.c @@ -400,12 +400,14 @@ static PyObject *Point_mul(PyObject * p1, PyObject * p2) static PyObject *Point_neg(PointObject *self) { int x; - for(x = 0; x < self->size; x++){ - self->coord[x] = -self->coord[x]; - } + float coord[3]; - return EXPP_incr_ret((PyObject *)self); + for(x = 0; x < self->size; x++) + coord[x] = -self->coord[x]; + + return newPointObject(coord, self->size, Py_NEW); } + //------------------------coerce(obj, obj)----------------------- //coercion of unknown types to type PointObject for numeric protocols /*Coercion() is called whenever a math operation has 2 operands that