From 6d0b3bf2b7e3089ff04e2fd6342b8d9d5f044caf Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Wed, 28 Jun 2006 17:13:39 +0000 Subject: Bugfix #4516: Allow ipo.addCurve() to create Key IPO curve for a corresponding keyblock. --- source/blender/python/api2_2x/Ipo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/python/api2_2x/Ipo.c') diff --git a/source/blender/python/api2_2x/Ipo.c b/source/blender/python/api2_2x/Ipo.c index 380d9bc2923..225908e2ed2 100644 --- a/source/blender/python/api2_2x/Ipo.c +++ b/source/blender/python/api2_2x/Ipo.c @@ -941,7 +941,14 @@ static PyObject *Ipo_addCurve( BPy_Ipo * self, PyObject * args ) * param = -1. */ - param = lookup_curve_name( cur_name, ipo->blocktype, self->mtex ); + if( ipo->blocktype != ID_KE ) { + param = lookup_curve_name( cur_name, ipo->blocktype, self->mtex ); + } else { + param = lookup_curve_key( cur_name, ipo ); + if( param == -2 ) + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "unable to find matching key data for Ipo" ); + } if( param == -1 ) return EXPP_ReturnPyObjError( PyExc_NameError, -- cgit v1.2.3