diff options
author | Jacques Guignot <guignot@wanadoo.fr> | 2003-07-21 04:08:30 +0400 |
---|---|---|
committer | Jacques Guignot <guignot@wanadoo.fr> | 2003-07-21 04:08:30 +0400 |
commit | ee5461b06a2e257590a90ee022d5446859427e74 (patch) | |
tree | 7fd153dfcc388c1a0d3a7e605fae759cf1f24c53 /source/blender | |
parent | 2a4fae99ceca7328398973fc797688d648ee68ea (diff) |
reincorporation in the cvs of modifications which had been lost.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/api2_2x/BezTriple.c | 77 | ||||
-rw-r--r-- | source/blender/python/api2_2x/BezTriple.h | 22 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Ipo.c | 53 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Ipo.h | 3 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Ipocurve.c | 104 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Ipocurve.h | 48 |
6 files changed, 247 insertions, 60 deletions
diff --git a/source/blender/python/api2_2x/BezTriple.c b/source/blender/python/api2_2x/BezTriple.c index 1f951b8a668..f7e531c300a 100644 --- a/source/blender/python/api2_2x/BezTriple.c +++ b/source/blender/python/api2_2x/BezTriple.c @@ -35,7 +35,7 @@ /* Function: M_BezTriple_New */ /* Python equivalent: Blender.BezTriple.New */ /*****************************************************************************/ -PyObject *M_BezTriple_New(PyObject *self, PyObject *args) +static PyObject *M_BezTriple_New(PyObject *self, PyObject *args) { return 0; } @@ -48,7 +48,7 @@ PyObject *M_BezTriple_New(PyObject *self, PyObject *args) /* passed in, a list of all ipo data names in the */ /* current scene is returned. */ /*****************************************************************************/ -PyObject *M_BezTriple_Get(PyObject *self, PyObject *args) +static PyObject *M_BezTriple_Get(PyObject *self, PyObject *args) { return 0; } @@ -57,12 +57,12 @@ PyObject *M_BezTriple_Get(PyObject *self, PyObject *args) /*****************************************************************************/ /* Python C_BezTriple methods: */ /*****************************************************************************/ -PyObject *BezTriple_getName(C_BezTriple *self) +static PyObject *BezTriple_getName(C_BezTriple *self) { return 0; } -PyObject *BezTriple_setName(C_BezTriple *self, PyObject *args) +static PyObject *BezTriple_setName(C_BezTriple *self, PyObject *args) { return 0; } @@ -73,12 +73,12 @@ PyObject *BezTriple_setName(C_BezTriple *self, PyObject *args) /* Description: This is a callback function for the C_BezTriple type. It is */ /* the destructor function. */ /*****************************************************************************/ -void BezTripleDeAlloc (C_BezTriple *self) +static void BezTripleDeAlloc (C_BezTriple *self) { PyObject_DEL (self); } -PyObject* BezTriple_getPoints (C_BezTriple *self) +static PyObject* BezTriple_getPoints (C_BezTriple *self) { struct BezTriple *bezt = self->beztriple; PyObject* l = PyList_New(0); @@ -90,6 +90,43 @@ struct BezTriple *bezt = self->beztriple; return l; } +static PyObject* BezTriple_geth1t (C_BezTriple *self) +{ + /*champ h1 de la struct*/ + return PyString_FromString("Auto"); +} +static PyObject* BezTriple_geth2t (C_BezTriple *self) +{ + /*champ h2 de la struct*/ + return PyString_FromString("Auto"); +} + +static PyObject* BezTriple_geth1 (C_BezTriple *self) +{ PyObject* ret = PyTuple_New(2); + PyTuple_SetItem(ret, 0 , PyFloat_FromDouble(self->beztriple->vec[0][0])); + PyTuple_SetItem(ret, 1 , PyFloat_FromDouble(self->beztriple->vec[0][1])); + return ret; +} +static PyObject* BezTriple_geth2 (C_BezTriple *self) +{ PyObject* ret = PyTuple_New(2); + PyTuple_SetItem(ret, 0 , PyFloat_FromDouble(self->beztriple->vec[2][0])); + PyTuple_SetItem(ret, 1 , PyFloat_FromDouble(self->beztriple->vec[2][1])); + return ret; +} +static PyObject* BezTriple_getf1 (C_BezTriple *self) +{ +return PyInt_FromLong(self->beztriple->f1); +} +static PyObject* BezTriple_getf2 (C_BezTriple *self) +{ +return PyInt_FromLong(self->beztriple->f2); +} + +static PyObject* BezTriple_getf3 (C_BezTriple *self) +{ +return PyInt_FromLong(self->beztriple->f3); +} + int BezTriple_setPoints (C_BezTriple *self,PyObject *value) { @@ -102,15 +139,27 @@ int BezTriple_setPoints (C_BezTriple *self,PyObject *value) return 0; } + /*****************************************************************************/ /* Function: BezTripleGetAttr */ /* Description: This is a callback function for the C_BezTriple type. It is */ /* the function that accesses C_BezTriple "member variables" and */ /* methods. */ /*****************************************************************************/ -PyObject *BezTripleGetAttr (C_BezTriple *self, char *name) +static PyObject *BezTripleGetAttr (C_BezTriple *self, char *name) { if (strcmp (name, "pt") == 0)return BezTriple_getPoints(self); +if (strcmp (name, "h1") == 0)return BezTriple_geth1(self); +if (strcmp (name, "h2") == 0)return BezTriple_geth2(self); +if (strcmp (name, "f1") == 0)return BezTriple_getf1(self); +if (strcmp (name, "f2") == 0)return BezTriple_getf2(self); +if (strcmp (name, "f3") == 0)return BezTriple_getf3(self); + +if (strcmp (name, "h1t") == 0)return BezTriple_geth1t(self); +if (strcmp (name, "h1Type") == 0)return BezTriple_geth1t(self); + +if (strcmp (name, "h2t") == 0)return BezTriple_geth2t(self); +if (strcmp (name, "h2Type") == 0)return BezTriple_geth2t(self); return Py_FindMethod(C_BezTriple_methods, (PyObject *)self, name); } @@ -119,7 +168,7 @@ if (strcmp (name, "pt") == 0)return BezTriple_getPoints(self); /* Description: This is a callback function for the C_BezTriple type. It is the */ /* function that sets BezTriple Data attributes (member variables).*/ /*****************************************************************************/ -int BezTripleSetAttr (C_BezTriple *self, char *name, PyObject *value) +static int BezTripleSetAttr (C_BezTriple *self, char *name, PyObject *value) { if (strcmp (name, "pt") == 0)return BezTriple_setPoints(self,value); return 0; /* normal exit */ @@ -130,9 +179,17 @@ if (strcmp (name, "pt") == 0)return BezTriple_setPoints(self,value); /* Description: This is a callback function for the C_BezTriple type. It */ /* builds a meaninful string to represent BezTriple objects. */ /*****************************************************************************/ -PyObject *BezTripleRepr (C_BezTriple *self) +static PyObject *BezTripleRepr (C_BezTriple *self) { - return PyString_FromString("[BezTriple]"); + /* float vec[3][3]; + float alfa; + short s[3][2]; + short h1, h2; + char f1, f2, f3, hide; + */ + char str[1000]; + sprintf(str,"BezTriple %f %f %f %f %f %f %f %f %f %f\n %d %d %d %d %d %d %d %d %d %d %d %d\n",self->beztriple->vec[0][0],self->beztriple->vec[0][1],self->beztriple->vec[0][2],self->beztriple->vec[1][0],self->beztriple->vec[1][1],self->beztriple->vec[1][2],self->beztriple->vec[2][0],self->beztriple->vec[2][1],self->beztriple->vec[2][2],self->beztriple->alfa,self->beztriple->s[0][0],self->beztriple->s[0][1],self->beztriple->s[1][0],self->beztriple->s[1][1],self->beztriple->s[2][0],self->beztriple->s[1][1],self->beztriple->h1,self->beztriple->h2,self->beztriple->f1,self->beztriple->f2,self->beztriple->f3,self->beztriple->hide); + return PyString_FromString(str); } /* Three Python BezTriple_Type helper functions needed by the Object module: */ diff --git a/source/blender/python/api2_2x/BezTriple.h b/source/blender/python/api2_2x/BezTriple.h index abd677f1735..c7c4b6e1dc4 100644 --- a/source/blender/python/api2_2x/BezTriple.h +++ b/source/blender/python/api2_2x/BezTriple.h @@ -49,8 +49,8 @@ /*****************************************************************************/ /* Python API function prototypes for the BezTriple module. */ /*****************************************************************************/ -PyObject *M_BezTriple_New (PyObject *self, PyObject *args); -PyObject *M_BezTriple_Get (PyObject *self, PyObject *args); +static PyObject *M_BezTriple_New (PyObject *self, PyObject *args); +static PyObject *M_BezTriple_Get (PyObject *self, PyObject *args); @@ -58,7 +58,7 @@ PyObject *M_BezTriple_Get (PyObject *self, PyObject *args); /* Python method structure definition for Blender.BezTriple module: */ /*****************************************************************************/ -static struct PyMethodDef M_BezTriple_methods[] = { +struct PyMethodDef M_BezTriple_methods[] = { {"New",(PyCFunction)M_BezTriple_New, METH_VARARGS|METH_KEYWORDS,0}, {"Get", M_BezTriple_Get, METH_VARARGS, 0}, {"get", M_BezTriple_Get, METH_VARARGS, 0}, @@ -76,8 +76,8 @@ typedef struct { /*****************************************************************************/ /* Python C_BezTriple methods declarations: */ /*****************************************************************************/ -PyObject *BezTriple_getName(C_BezTriple *self); -PyObject *BezTriple_setName(C_BezTriple *self, PyObject *args); +static PyObject *BezTriple_getName(C_BezTriple *self); +static PyObject *BezTriple_setName(C_BezTriple *self, PyObject *args); /*****************************************************************************/ /* Python C_BezTriple methods table: */ @@ -94,16 +94,16 @@ static PyMethodDef C_BezTriple_methods[] = { /*****************************************************************************/ /* Python BezTriple_Type callback function prototypes: */ /*****************************************************************************/ -void BezTripleDeAlloc (C_BezTriple *self); -//int BezTriplePrint (C_BezTriple *self, FILE *fp, int flags); -int BezTripleSetAttr (C_BezTriple *self, char *name, PyObject *v); -PyObject *BezTripleGetAttr (C_BezTriple *self, char *name); -PyObject *BezTripleRepr (C_BezTriple *self); +static void BezTripleDeAlloc (C_BezTriple *self); +//static int BezTriplePrint (C_BezTriple *self, FILE *fp, int flags); +static int BezTripleSetAttr (C_BezTriple *self, char *name, PyObject *v); +static PyObject *BezTripleGetAttr (C_BezTriple *self, char *name); +static PyObject *BezTripleRepr (C_BezTriple *self); /*****************************************************************************/ /* Python BezTriple_Type structure definition: */ /*****************************************************************************/ -static PyTypeObject BezTriple_Type = +PyTypeObject BezTriple_Type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ diff --git a/source/blender/python/api2_2x/Ipo.c b/source/blender/python/api2_2x/Ipo.c index 3a65a618e95..45173c55bc6 100644 --- a/source/blender/python/api2_2x/Ipo.c +++ b/source/blender/python/api2_2x/Ipo.c @@ -30,25 +30,31 @@ */ #include "Ipo.h" -#include "Ipocurve.h" /*****************************************************************************/ /* Function: M_Ipo_New */ /* Python equivalent: Blender.Ipo.New */ /*****************************************************************************/ + + + static PyObject *M_Ipo_New(PyObject *self, PyObject *args) { Ipo *add_ipo(char *name, int idcode); - char*name = NULL; - int code = 0; + char*name = NULL,*code=NULL; + int idcode = -1; C_Ipo *pyipo; Ipo *blipo; - if (!PyArg_ParseTuple(args, "si", &name,&code)) - return (EXPP_ReturnPyObjError (PyExc_TypeError, - "expected string int arguments")); - + if (!PyArg_ParseTuple(args, "ss", &code,&name)) + return (EXPP_ReturnPyObjError (PyExc_TypeError,"expected string int arguments")); + if (!strcmp(code,"Object"))idcode = ID_OB; + if (!strcmp(code,"Camera"))idcode = ID_CA; + if (!strcmp(code,"World"))idcode = ID_WO; + if (!strcmp(code,"Material"))idcode = ID_MA; + if (idcode == -1) + return (EXPP_ReturnPyObjError (PyExc_TypeError,"Bad code")); - blipo = add_ipo(name,code); + blipo = add_ipo(name,idcode); if (blipo) pyipo = (C_Ipo *)PyObject_NEW(C_Ipo, &Ipo_Type); @@ -259,6 +265,37 @@ static PyObject *Ipo_getNcurves(C_Ipo *self) } + +static PyObject *Ipo_addCurve(C_Ipo *self, PyObject *args) +{ + void *MEM_callocN(unsigned int len, char *str); + + int i = 0,typenumber = -1; + char*type = 0; + static char *name="mmm"; + char * nametab[24] = {"LocX","LocY","LocZ","dLocX","dLocY","dLocZ","RotX","RotY","RotZ","dRotX","dRotY","dRotZ","SizeX","SizeY","SizeZ","dSizeX","dSizeY","dSizeZ","Layer","Time","ColR","ColG","ColB","ColA"}; + if (!PyArg_ParseTuple(args, "s",&type)) + return (EXPP_ReturnPyObjError (PyExc_TypeError, "expected string argument")); + for(i = 0;i<24;i++) + if(!strcmp(nametab[i],type)) + typenumber=i+1; + + if (typenumber == -1) + return (EXPP_ReturnPyObjError (PyExc_TypeError, "unknown type")); + + IpoCurve*ptr = (IpoCurve*)MEM_callocN(sizeof(IpoCurve),name); + ptr->blocktype = 16975; + ptr->totvert = 0; + ptr->adrcode = typenumber; + ptr->ipo = 2; + ptr->flag = 7; + + BLI_addhead(&(self->ipo->curve),ptr); + + return IpoCurve_CreatePyObject (ptr); +} + + static PyObject *Ipo_getCurves(C_Ipo *self) { PyObject *attr = PyList_New(0); diff --git a/source/blender/python/api2_2x/Ipo.h b/source/blender/python/api2_2x/Ipo.h index 16d9c00de88..eaa71dbe4d1 100644 --- a/source/blender/python/api2_2x/Ipo.h +++ b/source/blender/python/api2_2x/Ipo.h @@ -93,6 +93,7 @@ static PyObject *Ipo_setBlocktype(C_Ipo *self, PyObject *args); static PyObject *Ipo_getRctf(C_Ipo *self); static PyObject *Ipo_setRctf(C_Ipo *self, PyObject *args); +static PyObject *Ipo_addCurve(C_Ipo *self, PyObject *args); static PyObject *Ipo_getNcurves(C_Ipo *self); static PyObject *Ipo_getNBezPoints(C_Ipo *self, PyObject *args); static PyObject *Ipo_DeleteBezPoints(C_Ipo *self, PyObject *args); @@ -120,6 +121,8 @@ static PyMethodDef C_Ipo_methods[] = { "() - Return Ipo rctf - "}, {"setRctf", (PyCFunction)Ipo_setRctf, METH_VARARGS, "(str) - Change Ipo rctf"}, + {"addCurve", (PyCFunction)Ipo_addCurve, METH_VARARGS, + "() - Return Ipo ncurves"}, {"getNcurves", (PyCFunction)Ipo_getNcurves, METH_NOARGS, "() - Return Ipo ncurves"}, {"getNBezPoints", (PyCFunction)Ipo_getNBezPoints, METH_VARARGS, diff --git a/source/blender/python/api2_2x/Ipocurve.c b/source/blender/python/api2_2x/Ipocurve.c index 50356103190..d0580cb780d 100644 --- a/source/blender/python/api2_2x/Ipocurve.c +++ b/source/blender/python/api2_2x/Ipocurve.c @@ -30,13 +30,15 @@ */ #include "Ipocurve.h" -#include "BezTriple.h" + /*****************************************************************************/ /* Function: M_IpoCurve_New */ /* Python equivalent: Blender.IpoCurve.New */ /*****************************************************************************/ -PyObject *M_IpoCurve_New(PyObject *self, PyObject *args) +static PyObject *M_IpoCurve_New(PyObject *self, PyObject *args) { + + return 0; } @@ -56,36 +58,106 @@ PyObject *IpoCurve_Init (void) } /*****************************************************************************/ -/* Function: M_IpoCurve_Get */ -/* Python equivalent: Blender.IpoCurve.Get */ -/* Description: Receives a string and returns the ipo data obj */ +/* Function: M_IpoCurve_Get */ +/* Python equivalent: Blender.IpoCurve.Get */ +/* Description: Receives a string and returns the ipo data obj */ /* whose name matches the string. If no argument is */ -/* passed in, a list of all ipo data names in the */ +/* passed in, a list of all ipo data names in the */ /* current scene is returned. */ /*****************************************************************************/ -PyObject *M_IpoCurve_Get(PyObject *self, PyObject *args) +static PyObject *M_IpoCurve_Get(PyObject *self, PyObject *args) { return 0; } /*****************************************************************************/ -/* Python C_IpoCurve methods: */ +/* Python C_IpoCurve methods: */ /*****************************************************************************/ -PyObject *IpoCurve_setName(C_IpoCurve *self, PyObject *args) +static PyObject *IpoCurve_setInterpolation( C_IpoCurve * self, PyObject *args) +{ + char*interpolationtype = 0; + int id = -1; + if (!PyArg_ParseTuple(args, "s", &interpolationtype)) + return (EXPP_ReturnPyObjError (PyExc_TypeError,"expected string argument")); + if (!strcmp(interpolationtype,"Bezier"))id = IPO_BEZ; + if (!strcmp(interpolationtype,"Constant"))id = IPO_CONST; + if (!strcmp(interpolationtype,"Linear"))id = IPO_LIN; + if (id == -1) + return (EXPP_ReturnPyObjError (PyExc_TypeError,"bad interpolation ytpe")); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject *IpoCurve_getInterpolation( C_IpoCurve * self) +{ + + Py_INCREF(Py_None); + return Py_None; +} +static PyObject *IpoCurve_setExtrapolation( C_IpoCurve * self, PyObject *args) +{ + + Py_INCREF(Py_None); + return Py_None; +} +static PyObject *IpoCurve_getExtrapolation( C_IpoCurve * self) +{ + + Py_INCREF(Py_None); + return Py_None; +} +static PyObject *IpoCurve_addBezier( C_IpoCurve * self, PyObject *args) +{ +short MEM_freeN(void *vmemh) ; + void *MEM_mallocN(unsigned int len, char *str); + char *str=0; + float x,y; + int npoints; + IpoCurve *icu; + BezTriple *bzt,*tmp; + static char name[10] = "mlml"; + PyObject*popo = 0; + if (!PyArg_ParseTuple(args, "Os", &popo,&str)) + return (EXPP_ReturnPyObjError (PyExc_TypeError,"expected list argument")); + x = PyFloat_AsDouble(PyTuple_GetItem(popo,0)); + y = PyFloat_AsDouble(PyTuple_GetItem(popo,1)); + icu = self->ipocurve; + npoints = icu->totvert; + tmp = icu->bezt; + icu->bezt = MEM_mallocN(sizeof(BezTriple)*(npoints+1),name); + if(tmp){ + memmove(icu->bezt,tmp,sizeof(BezTriple)*npoints); + MEM_freeN(tmp); + } + memmove(icu->bezt+npoints,icu->bezt,sizeof(BezTriple)); + icu->totvert++; + bzt = icu->bezt + npoints; + bzt->vec[0][0] = x-1; + bzt->vec[1][0] = x; + bzt->vec[2][0] = x+1; + bzt->vec[0][1] = y-1; + bzt->vec[1][1] = y; + bzt->vec[2][1] = y+1; + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *IpoCurve_setName(C_IpoCurve *self, PyObject *args) { return 0; } -PyObject *IpoCurve_Recalc(C_IpoCurve *self) +static PyObject *IpoCurve_Recalc(C_IpoCurve *self) { void testhandles_ipocurve(IpoCurve *icu); IpoCurve *icu = self->ipocurve; testhandles_ipocurve(icu); + Py_INCREF(Py_None); + return Py_None; } -PyObject* IpoCurve_getName (C_IpoCurve *self) +static PyObject* IpoCurve_getName (C_IpoCurve *self) { char * nametab[24] = {"LocX","LocY","LocZ","dLocX","dLocY","dLocZ","RotX","RotY","RotZ","dRotX","dRotY","dRotZ","SizeX","SizeY","SizeZ","dSizeX","dSizeY","dSizeZ","Layer","Time","ColR","ColG","ColB","ColA"}; @@ -101,12 +173,12 @@ return PyString_FromString(nametab[self->ipocurve->adrcode-1]); -void IpoCurveDeAlloc (C_IpoCurve *self) +static void IpoCurveDeAlloc (C_IpoCurve *self) { PyObject_DEL (self); } -PyObject* IpoCurve_getPoints (C_IpoCurve *self) +static PyObject* IpoCurve_getPoints (C_IpoCurve *self) { struct BezTriple *bezt; PyObject* l = PyList_New(0); @@ -141,7 +213,7 @@ struct BezTriple *bezt; /* the function that accesses C_IpoCurve "member variables" and */ /* methods. */ /*****************************************************************************/ -PyObject *IpoCurveGetAttr (C_IpoCurve *self, char *name) +static PyObject *IpoCurveGetAttr (C_IpoCurve *self, char *name) { if (strcmp (name, "bezierPoints") == 0)return IpoCurve_getPoints(self); if (strcmp (name, "name") == 0)return IpoCurve_getName(self); @@ -153,7 +225,7 @@ if (strcmp (name, "name") == 0)return IpoCurve_getName(self); /* Description: This is a callback function for the C_IpoCurve type. It is the */ /* function that sets IpoCurve Data attributes (member variables).*/ /*****************************************************************************/ -int IpoCurveSetAttr (C_IpoCurve *self, char *name, PyObject *value) +static int IpoCurveSetAttr (C_IpoCurve *self, char *name, PyObject *value) { if (strcmp (name, "bezierPoints") == 0)return IpoCurve_setPoints(self,value); return 0; /* normal exit */ @@ -164,7 +236,7 @@ if (strcmp (name, "bezierPoints") == 0)return IpoCurve_setPoints(self,value); /* Description: This is a callback function for the C_IpoCurve type. It */ /* builds a meaninful string to represent ipo objects. */ /*****************************************************************************/ -PyObject *IpoCurveRepr (C_IpoCurve *self) +static PyObject *IpoCurveRepr (C_IpoCurve *self) { char s[1024]; sprintf(s,"IpoCurve %d %d %d %d %d %d %d %d \n",self->ipocurve->blocktype,self->ipocurve->adrcode,self->ipocurve->vartype,self->ipocurve->totvert,self->ipocurve->ipo,self->ipocurve->extrap,self->ipocurve->flag,self->ipocurve->rt); diff --git a/source/blender/python/api2_2x/Ipocurve.h b/source/blender/python/api2_2x/Ipocurve.h index 332e25e6589..6864e5f43b9 100644 --- a/source/blender/python/api2_2x/Ipocurve.h +++ b/source/blender/python/api2_2x/Ipocurve.h @@ -49,24 +49,24 @@ /*****************************************************************************/ /* Python API function prototypes for the IpoCurve module. */ /*****************************************************************************/ -PyObject *M_IpoCurve_New (PyObject *self, PyObject *args); -PyObject *M_IpoCurve_Get (PyObject *self, PyObject *args); +static PyObject *M_IpoCurve_New (PyObject *self, PyObject *args); +static PyObject *M_IpoCurve_Get (PyObject *self, PyObject *args); /*****************************************************************************/ /* The following string definitions are used for documentation strings. */ /* In Python these will be written to the console when doing a */ /* Blender.IpoCurve.__doc__ */ /*****************************************************************************/ -static char M_IpoCurve_doc[] = ""; -static char M_IpoCurve_New_doc[] =""; -static char M_IpoCurve_Get_doc[] =""; +char M_IpoCurve_doc[] = ""; +char M_IpoCurve_New_doc[] =""; +char M_IpoCurve_Get_doc[] =""; /*****************************************************************************/ /* Python method structure definition for Blender.IpoCurve module: */ /*****************************************************************************/ -static struct PyMethodDef M_IpoCurve_methods[] = { +struct PyMethodDef M_IpoCurve_methods[] = { {"New",(PyCFunction)M_IpoCurve_New, METH_VARARGS|METH_KEYWORDS,M_IpoCurve_New_doc}, {"Get", M_IpoCurve_Get, METH_VARARGS, M_IpoCurve_Get_doc}, {"get", M_IpoCurve_Get, METH_VARARGS, M_IpoCurve_Get_doc}, @@ -84,9 +84,15 @@ typedef struct { /*****************************************************************************/ /* Python C_IpoCurve methods declarations: */ /*****************************************************************************/ -PyObject *IpoCurve_getName(C_IpoCurve *self); -PyObject *IpoCurve_Recalc(C_IpoCurve *self); -PyObject *IpoCurve_setName(C_IpoCurve *self, PyObject *args); +static PyObject *IpoCurve_getName(C_IpoCurve *self); +static PyObject *IpoCurve_Recalc(C_IpoCurve *self); +static PyObject *IpoCurve_setName(C_IpoCurve *self, PyObject *args); +static PyObject *IpoCurve_addBezier( C_IpoCurve*self, PyObject *args); +static PyObject *IpoCurve_setInterpolation( C_IpoCurve*self, PyObject *args); +static PyObject *IpoCurve_getInterpolation( C_IpoCurve*self); +static PyObject *IpoCurve_setExtrapolation( C_IpoCurve*self, PyObject *args); +static PyObject *IpoCurve_getExtrapolation( C_IpoCurve*self); + /*****************************************************************************/ /* Python C_IpoCurve methods table: */ @@ -96,8 +102,20 @@ static PyMethodDef C_IpoCurve_methods[] = { {"getName", (PyCFunction)IpoCurve_getName, METH_NOARGS, "() - Return IpoCurve Data name"}, {"Recalc", (PyCFunction)IpoCurve_Recalc, METH_NOARGS, + "() - Return IpoCurve Data name"}, + {"update", (PyCFunction)IpoCurve_Recalc, METH_NOARGS, "() - Return IpoCurve Data name"}, {"setName", (PyCFunction)IpoCurve_setName, METH_VARARGS, + "(str) - Change IpoCurve Data name"}, +{"addBezier", (PyCFunction)IpoCurve_addBezier, METH_VARARGS, + "(str) - Change IpoCurve Data name"}, +{"setInterpolation", (PyCFunction)IpoCurve_setInterpolation, METH_VARARGS, + "(str) - Change IpoCurve Data name"}, +{"getInterpolation", (PyCFunction)IpoCurve_getInterpolation, METH_NOARGS, + "(str) - Change IpoCurve Data name"}, +{"setExtrapolation", (PyCFunction)IpoCurve_setExtrapolation, METH_VARARGS, + "(str) - Change IpoCurve Data name"}, +{"getExtrapolation", (PyCFunction)IpoCurve_getExtrapolation, METH_NOARGS, "(str) - Change IpoCurve Data name"}, {0} }; @@ -105,16 +123,16 @@ static PyMethodDef C_IpoCurve_methods[] = { /*****************************************************************************/ /* Python IpoCurve_Type callback function prototypes: */ /*****************************************************************************/ -void IpoCurveDeAlloc (C_IpoCurve *self); -//int IpoCurvePrint (C_IpoCurve *self, FILE *fp, int flags); -int IpoCurveSetAttr (C_IpoCurve *self, char *name, PyObject *v); -PyObject *IpoCurveGetAttr (C_IpoCurve *self, char *name); -PyObject *IpoCurveRepr (C_IpoCurve *self); +static void IpoCurveDeAlloc (C_IpoCurve *self); +//static int IpoCurvePrint (C_IpoCurve *self, FILE *fp, int flags); +static int IpoCurveSetAttr (C_IpoCurve *self, char *name, PyObject *v); +static PyObject *IpoCurveGetAttr (C_IpoCurve *self, char *name); +static PyObject *IpoCurveRepr (C_IpoCurve *self); /*****************************************************************************/ /* Python IpoCurve_Type structure definition: */ /*****************************************************************************/ -static PyTypeObject IpoCurve_Type = +PyTypeObject IpoCurve_Type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ |