Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Hughes <khughes@pacific.edu>2006-06-28 21:13:39 +0400
committerKen Hughes <khughes@pacific.edu>2006-06-28 21:13:39 +0400
commit6d0b3bf2b7e3089ff04e2fd6342b8d9d5f044caf (patch)
tree3408e8b56f0eb2cdb387ca9f50b4f461c0773703 /source/blender/python/api2_2x/Ipo.c
parent853cf242766bfd94811c7a55a8786c2080bb41f2 (diff)
Bugfix #4516: Allow ipo.addCurve() to create Key IPO curve for a
corresponding keyblock.
Diffstat (limited to 'source/blender/python/api2_2x/Ipo.c')
-rw-r--r--source/blender/python/api2_2x/Ipo.c9
1 files changed, 8 insertions, 1 deletions
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,