From 4bd9775936c1b5a1656713d8c6a679b711b93d93 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 10 Oct 2005 18:05:30 +0000 Subject: Stupid me! Committed in wrong console with wrong dir... here's the rest of all files for the Ipo/Action/NLA makeover... --- source/blender/python/api2_2x/Ipo.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (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 55f6147012c..8ecd3bb5041 100644 --- a/source/blender/python/api2_2x/Ipo.c +++ b/source/blender/python/api2_2x/Ipo.c @@ -212,9 +212,9 @@ static PyObject *M_Ipo_New( PyObject * self, PyObject * args ) if( !strcmp( code, "Lamp" ) ) idcode = ID_LA; if( !strcmp( code, "Action" ) ) - idcode = ID_AC; + idcode = ID_PO; if( !strcmp( code, "Constraint" ) ) - idcode = IPO_CO; + idcode = ID_CO; if( !strcmp( code, "Sequence" ) ) idcode = ID_SEQ; if( !strcmp( code, "Curve" ) ) @@ -890,10 +890,10 @@ static PyObject *Ipo_addCurve( BPy_Ipo * self, PyObject * args ) case ID_MA: ok = Ipo_maIcuName( cur_name, ¶m ); break; - case ID_AC: + case ID_PO: ok = Ipo_acIcuName( cur_name, ¶m ); break; - case IPO_CO: + case ID_CO: ok = Ipo_coIcuName( cur_name, ¶m ); break; case ID_CU: @@ -913,14 +913,13 @@ static PyObject *Ipo_addCurve( BPy_Ipo * self, PyObject * args ) return EXPP_ReturnPyObjError ( PyExc_NameError, "curve name was invalid" ); - /* ask blender to create the new ipo curve */ - icu = get_ipocurve( NULL, ipo->blocktype, param, self->ipo ); - - if( icu == 0 ) /* could not create curve */ - return EXPP_ReturnPyObjError - ( PyExc_RuntimeError, - "blender could not create ipo curve" ); - + /* create the new ipo curve */ + icu = MEM_callocN(sizeof(IpoCurve), "Pyhon added ipocurve"); + icu->blocktype= ipo->blocktype; + icu->flag |= IPO_VISIBLE|IPO_AUTO_HORIZ; + icu->blocktype= ipo->blocktype; + icu->adrcode= param; + allspace( REMAKEIPO, 0 ); EXPP_allqueue( REDRAWIPO, 0 ); -- cgit v1.2.3