diff options
author | Stephen Swaney <sswaney@centurytel.net> | 2004-03-05 11:20:18 +0300 |
---|---|---|
committer | Stephen Swaney <sswaney@centurytel.net> | 2004-03-05 11:20:18 +0300 |
commit | 811e144c6f25ec299340f881c0e33108c7576d20 (patch) | |
tree | 0e35b1f643e82d5de264a6e298b0e5628aac96da /source/blender/python/api2_2x/Ipocurve.c | |
parent | 83804a7173c7ed0096d2b585ed1d958a665bccbb (diff) |
Fix for bug #1014
In IpoCurve.addBezier() method, set handles of newly added point to type Auto.
Fix provided by Roland Hess (harkyman).
Diffstat (limited to 'source/blender/python/api2_2x/Ipocurve.c')
-rw-r--r-- | source/blender/python/api2_2x/Ipocurve.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Ipocurve.c b/source/blender/python/api2_2x/Ipocurve.c index 56bb5f75226..ebb6eec5251 100644 --- a/source/blender/python/api2_2x/Ipocurve.c +++ b/source/blender/python/api2_2x/Ipocurve.c @@ -152,15 +152,16 @@ short MEM_freeN(void *vmemh) ; PyObject*popo = 0; if (!PyArg_ParseTuple(args, "O", &popo)) return (EXPP_ReturnPyObjError (PyExc_TypeError,"expected tuple argument")); + x = PyFloat_AsDouble(PyTuple_GetItem(popo,0)); y = PyFloat_AsDouble(PyTuple_GetItem(popo,1)); - icu = self->ipocurve; + 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,tmp,sizeof(BezTriple)*npoints); + MEM_freeN(tmp); } memmove(icu->bezt+npoints,icu->bezt,sizeof(BezTriple)); icu->totvert++; @@ -171,6 +172,10 @@ short MEM_freeN(void *vmemh) ; bzt->vec[0][1] = y-1; bzt->vec[1][1] = y; bzt->vec[2][1] = y+1; + /* set handle type to Auto */ + bzt->h1= HD_AUTO; + bzt->h2= HD_AUTO; + Py_INCREF(Py_None); return Py_None; } |