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_trackAxis(BPy_Object * self); +static PyObject *Object_upAxis(BPy_Object * self); /*****************************************************************************/ /* Python BPy_Object methods table: */ @@ -5076,7 +5078,16 @@ (getter)Object_getRBHalfExtents, (setter)NULL, "Rigid body physics bounds object type", NULL}, + {"trackAxis", + (getter)Object_trackAxis, (setter)NULL, + "Give the track axis return string 'x' | 'y' | 'z' | '-x' | '-y' | '-z' (readonly)", + NULL}, + {"upAxis", + (getter)Object_upAxis, (setter)NULL, + "Give the up axis return string 'x' | 'y' | 'z' (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,65 @@ return EXPP_setterWrapper( (void *)self, args, (setter)Object_setSBStiffQuads ); } + +static PyObject *Object_trackAxis( 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; + default: + ctr[0] = 'x'; + } + + return PyString_FromString(ctr); +} + +static PyObject *Object_upAxis( 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; + default: + cup[0] = 'z'; + } + + return PyString_FromString(cup); +}