diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-10-21 00:24:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-10-21 00:24:09 +0400 |
commit | 3a04520686c19074814c7de363f208459c69dfd1 (patch) | |
tree | e8bb0bd468703d6d2bfc8fd19df4d8fb23fe09ed /source/blender/python/api2_2x | |
parent | d7fa5ab16896d006fad531a60362766a6e7b2880 (diff) |
python api, slicing works differently on the 64bit ubuntu gutsy system, compared to the 32bit
install.
face.uv[:] was returning a blank list. and making smart UV projection script fail.
On one system Python is giving the slice function positive values, whereas on the 64bit system its
passing negative which are then clamped to zero.
made mathutils types accept negative values for slicing. This is very odd because both systems are
running ubuntu gutsy with python 2.5
Diffstat (limited to 'source/blender/python/api2_2x')
-rw-r--r-- | source/blender/python/api2_2x/euler.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/quat.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/vector.c | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/euler.c b/source/blender/python/api2_2x/euler.c index 8816c286943..53489e0f737 100644 --- a/source/blender/python/api2_2x/euler.c +++ b/source/blender/python/api2_2x/euler.c @@ -347,6 +347,7 @@ static PyObject *Euler_slice(EulerObject * self, int begin, int end) int count; CLAMP(begin, 0, 3); + if (end<0) end= 4+end; CLAMP(end, 0, 3); begin = MIN2(begin,end); @@ -368,6 +369,7 @@ static int Euler_ass_slice(EulerObject * self, int begin, int end, PyObject *e, *f; CLAMP(begin, 0, 3); + if (end<0) end= 4+end; CLAMP(end, 0, 3); begin = MIN2(begin,end); diff --git a/source/blender/python/api2_2x/quat.c b/source/blender/python/api2_2x/quat.c index 09b7ef5fe3c..3793db47686 100644 --- a/source/blender/python/api2_2x/quat.c +++ b/source/blender/python/api2_2x/quat.c @@ -350,6 +350,7 @@ static PyObject *Quaternion_slice(QuaternionObject * self, int begin, int end) int count; CLAMP(begin, 0, 4); + if (end<0) end= 5+end; CLAMP(end, 0, 4); begin = MIN2(begin,end); @@ -371,6 +372,7 @@ static int Quaternion_ass_slice(QuaternionObject * self, int begin, int end, PyObject *q, *f; CLAMP(begin, 0, 4); + if (end<0) end= 5+end; CLAMP(end, 0, 4); begin = MIN2(begin,end); diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c index 64ff035fa1f..2e13122f09f 100644 --- a/source/blender/python/api2_2x/vector.c +++ b/source/blender/python/api2_2x/vector.c @@ -359,6 +359,7 @@ static PyObject *Vector_slice(VectorObject * self, int begin, int end) int count; CLAMP(begin, 0, self->size); + if (end<0) end= self->size+end+1; CLAMP(end, 0, self->size); begin = MIN2(begin,end); @@ -380,6 +381,7 @@ static int Vector_ass_slice(VectorObject * self, int begin, int end, PyObject *v; CLAMP(begin, 0, self->size); + if (end<0) end= self->size+end+1; CLAMP(end, 0, self->size); begin = MIN2(begin,end); |