diff options
author | Ken Hughes <khughes@pacific.edu> | 2006-11-14 00:14:48 +0300 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2006-11-14 00:14:48 +0300 |
commit | 2e133599da435a30604d63c80bb58f2cc5f97290 (patch) | |
tree | 6c683a2dca2dedafe90d4d0b416bd07d1db00dd1 | |
parent | de7322f96d4a9d672636b9f76b37969645b874f3 (diff) |
Python API:
Bugfix #5075: make curve.update() recalculate bezier curve handles. This
would/should be called after changing the handles of a BezTriple.
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Curve.c | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 22ace2d20bf..72cfb820138 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2192,7 +2192,7 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */ BezTriple *bezt, *prev, *next; short a; - if((nu->type & 7)!=1) return; + if((nu->type & 7)!=CU_BEZIER) return; if(nu->pntsu<2) return; a= nu->pntsu; diff --git a/source/blender/python/api2_2x/Curve.c b/source/blender/python/api2_2x/Curve.c index 75c8a3801a3..69afe176ca6 100644 --- a/source/blender/python/api2_2x/Curve.c +++ b/source/blender/python/api2_2x/Curve.c @@ -1280,6 +1280,15 @@ static PyObject *Curve_appendNurb( BPy_Curve * self, PyObject * args ) PyObject *Curve_update( BPy_Curve * self ) { + Nurb *nu = self->curve->nurb.first; + + /* recalculate handles for each curve: calchandlesNurb() will make + * sure curves are bezier first */ + while( nu ) { + calchandlesNurb ( nu ); + nu = nu->next; + } + Object_updateDag( (void*) self->curve ); Py_RETURN_NONE; |