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
This commit is contained in:
Campbell Barton 2007-10-20 20:24:09 +00:00
parent d7fa5ab168
commit 3a04520686
3 changed files with 6 additions and 0 deletions

@ -347,6 +347,7 @@ static PyObject *Euler_slice(EulerObject * self, int begin, int end)
int count; int count;
CLAMP(begin, 0, 3); CLAMP(begin, 0, 3);
if (end<0) end= 4+end;
CLAMP(end, 0, 3); CLAMP(end, 0, 3);
begin = MIN2(begin,end); begin = MIN2(begin,end);
@ -368,6 +369,7 @@ static int Euler_ass_slice(EulerObject * self, int begin, int end,
PyObject *e, *f; PyObject *e, *f;
CLAMP(begin, 0, 3); CLAMP(begin, 0, 3);
if (end<0) end= 4+end;
CLAMP(end, 0, 3); CLAMP(end, 0, 3);
begin = MIN2(begin,end); begin = MIN2(begin,end);

@ -350,6 +350,7 @@ static PyObject *Quaternion_slice(QuaternionObject * self, int begin, int end)
int count; int count;
CLAMP(begin, 0, 4); CLAMP(begin, 0, 4);
if (end<0) end= 5+end;
CLAMP(end, 0, 4); CLAMP(end, 0, 4);
begin = MIN2(begin,end); begin = MIN2(begin,end);
@ -371,6 +372,7 @@ static int Quaternion_ass_slice(QuaternionObject * self, int begin, int end,
PyObject *q, *f; PyObject *q, *f;
CLAMP(begin, 0, 4); CLAMP(begin, 0, 4);
if (end<0) end= 5+end;
CLAMP(end, 0, 4); CLAMP(end, 0, 4);
begin = MIN2(begin,end); begin = MIN2(begin,end);

@ -359,6 +359,7 @@ static PyObject *Vector_slice(VectorObject * self, int begin, int end)
int count; int count;
CLAMP(begin, 0, self->size); CLAMP(begin, 0, self->size);
if (end<0) end= self->size+end+1;
CLAMP(end, 0, self->size); CLAMP(end, 0, self->size);
begin = MIN2(begin,end); begin = MIN2(begin,end);
@ -380,6 +381,7 @@ static int Vector_ass_slice(VectorObject * self, int begin, int end,
PyObject *v; PyObject *v;
CLAMP(begin, 0, self->size); CLAMP(begin, 0, self->size);
if (end<0) end= self->size+end+1;
CLAMP(end, 0, self->size); CLAMP(end, 0, self->size);
begin = MIN2(begin,end); begin = MIN2(begin,end);