Index: Object.c =================================================================== --- Object.c (revision 14038) +++ Object.c (working copy) @@ -459,6 +459,8 @@ static PyObject *Object_copyNLA( BPy_Object * self, PyObject * args ); static PyObject *Object_convertActionToStrip( BPy_Object * self ); static PyObject *Object_copy(BPy_Object * self); /* __copy__ */ +static PyObject *Object_trackVector(BPy_Object * self); +static PyObject *Object_upVector(BPy_Object * self); /*****************************************************************************/ /* Python BPy_Object methods table: */ @@ -5076,7 +5078,16 @@ (getter)Object_getRBHalfExtents, (setter)NULL, "Rigid body physics bounds object type", NULL}, + {"trackVector", + (getter)Object_trackVector, (setter)NULL, + "Give the track vector (readonly)", + NULL}, + {"upVector", + (getter)Object_upVector, (setter)NULL, + "Give the up vector (readonly)", + NULL}, + {"restrictDisplay", (getter)Object_getRestricted, (setter)Object_setRestricted, "Toggle object restrictions", @@ -5188,6 +5199,7 @@ NULL }; + static PyObject *M_Object_DrawModesDict( void ) { PyObject *M = PyConstant_New( ); @@ -5964,3 +5976,61 @@ return EXPP_setterWrapper( (void *)self, args, (setter)Object_setSBStiffQuads ); } + +static PyObject *Object_trackVector( BPy_Object * self ) +{ + Object* ob; + unsigned char ctr[3]; + + ctr [1] = ctr[2] = 0; + ob = self->object; + + switch(ob->trackflag){ + case(0): + ctr[0] = 'x'; + break; + case(1): + ctr[0] = 'y'; + break; + case(2): + ctr[0] = 'z'; + break; + case(3): + ctr[0] = '-'; + ctr[1] = 'x'; + break; + case(4): + ctr[0] = '-'; + ctr[1] = 'y'; + break; + case(5): + ctr[0] = '-'; + ctr[1] = 'y'; + break; + } + + return PyString_FromString(ctr); +} + +static PyObject *Object_upVector( BPy_Object * self ) +{ + Object* ob; + unsigned char cup[2]; + + cup[1] = 0; + ob = self->object; + + switch(ob->upflag){ + case(0): + cup[0] = 'x'; + break; + case(1): + cup[0] = 'y'; + break; + case(2): + cup[0] = 'z'; + break; + } + + return PyString_FromString(cup); +}