137
166
"(int,int) - deprecated: see ipocurve.bezierPoints[]"},
138
167
{"setCurveBeztriple", ( PyCFunction ) Ipo_setCurveBeztriple, METH_VARARGS,
139
168
"(int,int,list) - set a BezTriple"},
140
{"getCurves", ( PyCFunction ) Ipo_getCurves, METH_NOARGS,
141
"() - Return list of all defined Ipo curves"},
142
{"getCurve", ( PyCFunction ) Ipo_getCurve, METH_VARARGS,
143
"(str|int) - Returns specified Ipo curve"},
144
169
{NULL, NULL, 0, NULL}
147
172
/*****************************************************************************/
148
/* Python Ipo_Type callback function prototypes: */
149
/*****************************************************************************/
150
static void IpoDeAlloc( BPy_Ipo * self );
173
/* Python BPy_Ipo attributes get/set structure: */
174
/*****************************************************************************/
175
static PyGetSetDef BPy_Ipo_getseters[] = {
177
(getter)Ipo_getName, (setter)Ipo_setName,
181
(getter)Ipo_getCurves, (setter)NULL,
185
(getter)Ipo_getCurveNames, (setter)NULL,
186
"Ipo curve constants (values depend on Ipo type)",
189
(getter)Ipo_getChannel, (setter)Ipo_setChannel,
190
"Ipo texture channel (world, lamp, material Ipos only)",
194
(getter)Ipo_getBlocktype, (setter)NULL,
198
(getter)Ipo_getRctf, (setter)Ipo_setRctf,
201
{NULL,NULL,NULL,NULL,NULL} /* Sentinel */
204
/*****************************************************************************/
205
/* Python Ipo_Type Mapping Methods table: */
206
/*****************************************************************************/
207
static PyMappingMethods Ipo_as_mapping = {
208
( inquiry ) Ipo_length, /* mp_length */
209
( binaryfunc ) Ipo_getIpoCurveByName, /* mp_subscript */
210
( objobjargproc ) Ipo_setIpoCurveByName, /* mp_ass_subscript */
213
static PySequenceMethods Ipo_as_sequence = {
214
( inquiry ) 0, /* sq_length */
215
( binaryfunc ) 0, /* sq_concat */
216
( intargfunc ) 0, /* sq_repeat */
217
( intargfunc ) 0, /* sq_item */
218
( intintargfunc ) 0, /* sq_slice */
219
( intobjargproc ) 0, /* sq_ass_item */
220
( intintobjargproc ) 0, /* sq_ass_slice */
221
( objobjproc ) Ipo_contains, /* sq_contains */
222
( binaryfunc ) 0, /* sq_inplace_concat */
223
( intargfunc ) 0, /* sq_inplace_repeat */
226
/*****************************************************************************/
227
/* Python Ipo_Type callback function prototypes: */
228
/*****************************************************************************/
229
static void Ipo_dealloc( BPy_Ipo * self );
151
230
//static int IpoPrint (BPy_Ipo *self, FILE *fp, int flags);
152
static int IpoSetAttr( BPy_Ipo * self, char *name, PyObject * v );
153
static PyObject *IpoGetAttr( BPy_Ipo * self, char *name );
154
static PyObject *IpoRepr( BPy_Ipo * self );
231
static PyObject *Ipo_repr( BPy_Ipo * self );
232
static PyObject *Ipo_getIter( BPy_Ipo * self );
233
static PyObject *Ipo_nextIter( BPy_Ipo * self );
235
/* #define CURVEATTRS */ /* uncomment to enable curves as Ipo attributes */
238
static PyGetSetDef BPy_Ipocurve_getseter = {
240
(getter)NULL, (setter)NULL,
245
void generate_curveattrs( PyObject* dict, int blocktype )
247
typedef char * (*namefunc)(int, ... );
248
namefunc lookup_name;
254
switch ( blocktype ) {
256
lookup_name = (namefunc)getname_ob_ei;
261
lookup_name = (namefunc)getname_mat_ei;
266
lookup_name = (namefunc)getname_cam_ei;
271
lookup_name = (namefunc)getname_la_ei;
276
lookup_name = (namefunc)getname_tex_ei;
281
lookup_name = (namefunc)getname_world_ei;
286
lookup_name = (namefunc)getname_ac_ei;
291
lookup_name = (namefunc)getname_co_ei;
296
lookup_name = (namefunc)getname_cu_ei;
301
lookup_name = (namefunc)getname_seq_ei;
307
desc = PyDescr_NewGetSet( &Ipo_Type, &BPy_Ipocurve_getseter );
309
strcpy( name, lookup_name( *vals ) );
310
*name = tolower( *name );
311
PyDict_SetItemString( dict, name, desc );
317
static short lookup_curve_name( char *, int , int );
319
static PyObject *getattro( PyObject *self, PyObject *value )
321
char *name = PyString_AS_STRING( value );
322
Ipo *ipo = ((BPy_Ipo *)self)->ipo;
326
if( !strcmp(name, "__class__") )
327
return PyObject_GenericGetAttr( self, value );
329
if( !strcmp(name, "__dict__") ) /* no effect */
332
dict = PyDict_Copy( self->ob_type->tp_dict );
333
generate_curveattrs( dict, ipo->blocktype );
337
adrcode = lookup_curve_name( name, ipo->blocktype,
338
((BPy_Ipo *)self)->mtex );
340
if( adrcode != -1 ) {
341
for( icu = ipo->curve.first; icu; icu = icu->next )
342
if( icu->adrcode == adrcode )
343
return IpoCurve_CreatePyObject( icu );
347
return PyObject_GenericGetAttr( self, value );
156
351
/*****************************************************************************/
157
/* Python Ipo_Type structure definition: */
352
/* Python Ipo_Type structure definition: */
158
353
/*****************************************************************************/
159
354
PyTypeObject Ipo_Type = {
160
PyObject_HEAD_INIT( NULL ) /* required macro */ 0, /* ob_size */
162
sizeof( BPy_Ipo ), /* tp_basicsize */
165
( destructor ) IpoDeAlloc, /* tp_dealloc */
167
( getattrfunc ) IpoGetAttr, /* tp_getattr */
168
( setattrfunc ) IpoSetAttr, /* tp_setattr */
170
( reprfunc ) IpoRepr, /* tp_repr */
171
0, /* tp_as_number */
172
0, /* tp_as_sequence */
173
0, /* tp_as_mapping */
178
BPy_Ipo_methods, /* tp_methods */
355
PyObject_HEAD_INIT( NULL ) /* required py macro */
357
/* For printing, in format "<module>.<name>" */
358
"Blender Ipo", /* char *tp_name; */
359
sizeof( BPy_Ipo ), /* int tp_basicsize; */
360
0, /* tp_itemsize; For allocation */
362
/* Methods to implement standard operations */
364
( destructor ) Ipo_dealloc,/* destructor tp_dealloc; */
365
NULL, /* printfunc tp_print; */
366
NULL, /* getattrfunc tp_getattr; */
367
NULL, /* setattrfunc tp_setattr; */
368
NULL, /* cmpfunc tp_compare; */
369
( reprfunc ) Ipo_repr, /* reprfunc tp_repr; */
371
/* Method suites for standard classes */
373
NULL, /* PyNumberMethods *tp_as_number; */
374
&Ipo_as_sequence, /* PySequenceMethods *tp_as_sequence; */
375
&Ipo_as_mapping, /* PyMappingMethods *tp_as_mapping; */
377
/* More standard operations (here for binary compatibility) */
379
NULL, /* hashfunc tp_hash; */
380
NULL, /* ternaryfunc tp_call; */
381
NULL, /* reprfunc tp_str; */
383
(getattrofunc)getattro,
385
NULL, /* getattrofunc tp_getattro; */
387
NULL, /* setattrofunc tp_setattro; */
389
/* Functions to access object as input/output buffer */
390
NULL, /* PyBufferProcs *tp_as_buffer; */
392
/*** Flags to define presence of optional/expanded features ***/
393
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
395
NULL, /* char *tp_doc; Documentation string */
396
/*** Assigned meaning in release 2.0 ***/
397
/* call function for all accessible objects */
398
NULL, /* traverseproc tp_traverse; */
400
/* delete references to contained objects */
401
NULL, /* inquiry tp_clear; */
403
/*** Assigned meaning in release 2.1 ***/
404
/*** rich comparisons ***/
405
NULL, /* richcmpfunc tp_richcompare; */
407
/*** weak reference enabler ***/
408
0, /* long tp_weaklistoffset; */
410
/*** Added in release 2.2 ***/
412
( getiterfunc) Ipo_getIter, /* getiterfunc tp_iter; */
413
( iternextfunc ) Ipo_nextIter, /* iternextfunc tp_iternext; */
415
/*** Attribute descriptor and subclassing stuff ***/
416
BPy_Ipo_methods, /* struct PyMethodDef *tp_methods; */
417
NULL, /* struct PyMemberDef *tp_members; */
418
BPy_Ipo_getseters, /* struct PyGetSetDef *tp_getset; */
419
NULL, /* struct _typeobject *tp_base; */
420
NULL, /* PyObject *tp_dict; */
421
NULL, /* descrgetfunc tp_descr_get; */
422
NULL, /* descrsetfunc tp_descr_set; */
423
0, /* long tp_dictoffset; */
424
NULL, /* initproc tp_init; */
425
NULL, /* allocfunc tp_alloc; */
426
NULL, /* newfunc tp_new; */
427
/* Low-level free-memory routine */
428
NULL, /* freefunc tp_free; */
429
/* For PyObject_IS_GC */
430
NULL, /* inquiry tp_is_gc; */
431
NULL, /* PyObject *tp_bases; */
432
/* method resolution order */
433
NULL, /* PyObject *tp_mro; */
434
NULL, /* PyObject *tp_cache; */
435
NULL, /* PyObject *tp_subclasses; */
436
NULL, /* PyObject *tp_weaklist; */
182
440
/*****************************************************************************/
441
/* internal utility routines */
442
/*****************************************************************************/
445
* Search through list of known Ipocurves for a particular name.
447
* str: name of curve we are searching for
448
* blocktype: type of Ipo
449
* channel: texture channel number, for World/Lamp/Material curves
451
* returns the adrcode for the named curve if it exists, -1 otherwise
454
/* this is needed since getname_ob_ei() is different from the rest */
456
typedef char * (*namefunc)(int, ... );
458
static short lookup_curve_name( char *str, int blocktype, int channel )
460
namefunc lookup_name;
461
int *adrcodes = NULL;
464
/* make sure channel type is ignored when it should be */
465
if( blocktype != ID_WO && blocktype != ID_LA && blocktype != ID_MA )
468
switch ( blocktype ) {
470
lookup_name = (namefunc)getname_ob_ei;
475
lookup_name = (namefunc)getname_mat_ei;
480
lookup_name = (namefunc)getname_cam_ei;
485
lookup_name = (namefunc)getname_la_ei;
490
lookup_name = (namefunc)getname_tex_ei;
495
lookup_name = (namefunc)getname_world_ei;
500
lookup_name = (namefunc)getname_ac_ei;
505
lookup_name = (namefunc)getname_co_ei;
510
lookup_name = (namefunc)getname_cu_ei;
515
lookup_name = (namefunc)getname_seq_ei;
519
case ID_KE: /* shouldn't happen */
525
char *name = lookup_name ( *adrcodes );
527
/* if not a texture channel, just return the adrcode */
528
if( !strcmp( str, name ) ) {
529
if( channel == -1 || *adrcodes < MA_MAP1 )
530
return (short)*adrcodes;
532
/* otherwise adjust adrcode to include current channel */
534
int param = (short)*adrcodes & ~MA_MAP1;
535
param |= texchannel_to_adrcode( channel );
544
static short lookup_curve_key( char *str, Ipo *ipo )
548
/* find the ipo in the keylist */
549
for( keyiter = G.main->key.first; keyiter; keyiter = keyiter->id.next ) {
550
if( keyiter->ipo == ipo ) {
551
KeyBlock *block = keyiter->block.first;
553
/* look for a matching string, get the adrcode */
554
for( block = keyiter->block.first; block; block = block->next )
555
if( !strcmp( str, block->name ) )
556
return block->adrcode;
558
/* no match; no addr code */
563
/* error if the ipo isn't in the list */
568
* Search through list of known Ipocurves for a particular adrcode.
570
* code: adrcode of curve we are searching for
571
* blocktype: type of Ipo
572
* channel: texture channel number, for World/Lamp/Material curves
574
* returns the adrcode for the named curve if it exists, -1 otherwise
577
static short lookup_curve_adrcode( int code, int blocktype, int channel )
579
int *adrcodes = NULL;
582
switch ( blocktype ) {
629
if( *adrcodes == code ) {
631
/* if not a texture channel, just return the adrcode */
632
if( channel == -1 || *adrcodes < MA_MAP1 )
633
return (short)*adrcodes;
635
/* otherwise adjust adrcode to include current channel */
637
int param = *adrcodes & ~MA_MAP1;
638
param |= texchannel_to_adrcode( channel );
648
* Delete an IpoCurve from an Ipo
651
static void del_ipocurve( Ipo * ipo, IpoCurve * icu ) {
652
BLI_remlink( &( ipo->curve ), icu );
654
MEM_freeN( icu->bezt );
656
MEM_freeN( icu->driver );
659
/* have to do this to avoid crashes in the IPO window */
660
allspace( REMAKEIPO, 0 );
661
EXPP_allqueue( REDRAWIPO, 0 );
664
/*****************************************************************************/
665
/* Python BPy_Ipo functions: */
666
/*****************************************************************************/
668
/*****************************************************************************/
183
669
/* Function: M_Ipo_New */
184
670
/* Python equivalent: Blender.Ipo.New */
185
671
/*****************************************************************************/
187
static PyObject *M_Ipo_New( PyObject * self, PyObject * args )
673
static PyObject *M_Ipo_New( PyObject * self_unused, PyObject * args )
189
Ipo *add_ipo( char *name, int idcode );
190
675
char *name = NULL, *code = NULL;
195
679
if( !PyArg_ParseTuple( args, "ss", &code, &name ) )
196
return ( EXPP_ReturnPyObjError
198
"expected string string arguments" ) );
680
return EXPP_ReturnPyObjError( PyExc_TypeError,
681
"expected two string arguments" );
200
683
if( !strcmp( code, "Object" ) )
202
if( !strcmp( code, "Camera" ) )
685
else if( !strcmp( code, "Camera" ) )
204
if( !strcmp( code, "World" ) )
687
else if( !strcmp( code, "World" ) )
206
if( !strcmp( code, "Material" ) )
689
else if( !strcmp( code, "Material" ) )
208
if( !strcmp( code, "Texture" ) )
691
else if( !strcmp( code, "Texture" ) )
210
if( !strcmp( code, "Lamp" ) )
693
else if( !strcmp( code, "Lamp" ) )
212
if( !strcmp( code, "Action" ) )
695
else if( !strcmp( code, "Action" ) )
214
if( !strcmp( code, "Constraint" ) )
697
else if( !strcmp( code, "Constraint" ) )
216
if( !strcmp( code, "Sequence" ) )
699
else if( !strcmp( code, "Sequence" ) )
218
if( !strcmp( code, "Curve" ) )
701
else if( !strcmp( code, "Curve" ) )
220
if( !strcmp( code, "Key" ) )
703
else if( !strcmp( code, "Key" ) )
224
return ( EXPP_ReturnPyObjError
225
( PyExc_TypeError, "Bad code" ) );
705
else return EXPP_ReturnPyObjError( PyExc_ValueError,
706
"unknown Ipo code" );
228
708
blipo = add_ipo( name, idcode );
780
* This should probably be deprecated too? Or else documented in epydocs.
781
* Seems very similar to Ipocurve.recalc().
320
static PyObject *M_Ipo_Recalc( PyObject * self, PyObject * args )
784
/*****************************************************************************/
785
/* Function: M_Ipo_Recalc */
786
/* Python equivalent: Blender.Ipo.Recalc */
787
/* Description: Receives (presumably) an IpoCurve object and */
788
/* updates the curve after changes to control points. */
789
/*****************************************************************************/
790
static PyObject *M_Ipo_Recalc( PyObject * self_unused, PyObject * args )
325
if( !PyArg_ParseTuple( args, "O!", &IpoCurve_Type, &obj ) )
794
if( !PyArg_ParseTuple( args, "O!", &IpoCurve_Type, &pyobj ) )
326
795
return EXPP_ReturnPyObjError( PyExc_TypeError,
327
796
"expected Ipo curve argument" );
329
icu = IpoCurve_FromPyObject( obj );
330
testhandles_ipocurve( icu );
332
Py_INCREF( Py_None );
337
/*****************************************************************************/
338
/* Function: Ipo_Init */
339
/*****************************************************************************/
340
PyObject *Ipo_Init( void )
344
Ipo_Type.ob_type = &PyType_Type;
346
submodule = Py_InitModule3( "Blender.Ipo", M_Ipo_methods, M_Ipo_doc );
348
return ( submodule );
351
/*****************************************************************************/
352
/* Python BPy_Ipo methods: */
353
/*****************************************************************************/
798
testhandles_ipocurve( IpoCurve_FromPyObject( pyobj ) );
803
/*****************************************************************************/
804
/* Python BPy_Ipo methods: */
805
/*****************************************************************************/
354
807
static PyObject *Ipo_getName( BPy_Ipo * self )
356
809
PyObject *attr = PyString_FromString( self->ipo->id.name + 2 );
360
Py_INCREF( Py_None );
814
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
815
"couldn't get Ipo.name attribute" );
365
static PyObject *Ipo_setName( BPy_Ipo * self, PyObject * args )
818
static int Ipo_setName( BPy_Ipo * self, PyObject * args )
370
if( !PyArg_ParseTuple( args, "s", &name ) )
371
return ( EXPP_ReturnPyObjError
372
( PyExc_TypeError, "expected string argument" ) );
823
name = PyString_AsString( args );
825
return EXPP_ReturnIntError( PyExc_TypeError,
826
"expected string argument" );
374
828
PyOS_snprintf( buf, sizeof( buf ), "%s", name );
376
830
rename_id( &self->ipo->id, buf );
378
Py_INCREF( Py_None );
382
835
static PyObject *Ipo_getBlocktype( BPy_Ipo * self )
384
837
PyObject *attr = PyInt_FromLong( self->ipo->blocktype );
387
return ( EXPP_ReturnPyObjError
388
( PyExc_RuntimeError,
389
"couldn't get Ipo.blocktype attribute" ) );
842
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
843
"couldn't get Ipo.blocktype attribute" );
393
static PyObject *Ipo_setBlocktype( BPy_Ipo * self, PyObject * args )
846
static int Ipo_setBlocktype( BPy_Ipo * self, PyObject * args )
397
if( !PyArg_ParseTuple( args, "i", &blocktype ) )
398
return ( EXPP_ReturnPyObjError
399
( PyExc_TypeError, "expected string argument" ) );
401
self->ipo->blocktype = ( short ) blocktype;
403
Py_INCREF( Py_None );
848
if( !PyInt_CheckExact( args ) )
849
return EXPP_ReturnIntError( PyExc_TypeError,
850
"expected int argument" );
852
self->ipo->blocktype = (short)PyInt_AS_LONG( args );
408
857
static PyObject *Ipo_getRctf( BPy_Ipo * self )
410
859
PyObject *l = PyList_New( 0 );
413
862
PyList_Append( l, PyFloat_FromDouble( self->ipo->cur.ymin ) );
414
863
PyList_Append( l, PyFloat_FromDouble( self->ipo->cur.ymax ) );
420
static PyObject *Ipo_setRctf( BPy_Ipo * self, PyObject * args )
867
static int Ipo_setRctf( BPy_Ipo * self, PyObject * args )
423
871
if( !PyArg_ParseTuple( args, "ffff", v, v + 1, v + 2, v + 3 ) )
424
return ( EXPP_ReturnPyObjError
425
( PyExc_TypeError, "expected 4 float argument" ) );
872
return EXPP_ReturnIntError( PyExc_TypeError,
873
"expected a tuple of 4 floats" );
427
875
self->ipo->cur.xmin = v[0];
428
876
self->ipo->cur.xmax = v[1];
429
877
self->ipo->cur.ymin = v[2];
430
878
self->ipo->cur.ymax = v[3];
432
Py_INCREF( Py_None );
884
* Get total number of Ipo curves for this Ipo. NOTE: this function
885
* returns all curves for Ipos which have texture channels, unlike
436
889
static PyObject *Ipo_getNcurves( BPy_Ipo * self )
441
894
for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
445
return ( PyInt_FromLong( i ) );
450
Lamp ipo Name to Channel
453
static int Ipo_laIcuName( char *s, int *param )
459
char *lamp_names[LA_TOTIPO] =
460
{ "Energ", "R", "G", "B", "Dist", "SpoSi",
461
"SpoBl", "Quad1", "Quad2", "HaInt",
462
/* lamp texture names */
463
"OfsX", "OfsY", "OfsZ", "SizeX", "SizeY",
464
"SizeZ", "texR", "texG", "texB", "DefVar",
468
for( i = 0; i < LA_TOTIPO; i++ ) {
469
if( !strcmp( s, lamp_names[i] ) ) { /* found it! */
480
World Ipo Name to Channel
483
static int Ipo_woIcuName( char *s, int *param )
485
extern int wo_ar[]; /* channel values from ipo.c */
488
char *world_names[WO_TOTIPO] = { "HorR", "HorG", "HorB",
489
"ZenR", "ZenG", "ZenB",
491
"Misi", "MisDi", "MisSta", "MisHi",
492
"StarR", "StarB", "StarG",
494
/* world textures names */
495
"OfsX", "OfsY", "OfsZ",
496
"SizeX", "SizeY", "SizeZ",
497
"texR", "texG", "texB",
498
"DefVar", "Col", "Nor", "Var",
501
for( i = 0; i < WO_TOTIPO; i++ ) {
502
if( !strcmp( s, world_names[i] ) ) { /* found it! */
511
static int Ipo_maIcuName( char *s, int *param )
518
char *material_names[MA_TOTIPO] = { "R", "G", "B",
519
"SpecR", "SpecG", "SpecB",
520
"MirR", "MirG", "MirB", "Ref", "Alpha",
521
"Emit", "Amb", "Spec",
522
"Hard", "SpTra", "Ior", "Mode",
524
"RayMir", "FresMir", "FresMirI",
525
"FresTra", "FresTraI",
527
"OfsX", "OfsY", "OfsZ",
528
"SizeX", "SizeY", "SizeZ",
529
"texR", "texG", "texB",
530
"DefVar", "Col", "Nor", "Var",
535
for( i = 0; i < MA_TOTIPO; i++ ) {
536
if( !strcmp( s, material_names[i] ) ) { /* found it! */
545
static int Ipo_keIcuName( char *s, int *param )
550
if( !strcmp( s, "Speed" ) ) {
554
for( nr = 1; nr < 64; nr++ ) {
555
sprintf( key, "Key %d", nr );
556
if( !strcmp( s, key ) ) {
566
static int Ipo_seqIcuName( char *s, int *param )
569
if( !strcmp( s, "Fac" ) ) {
577
static int Ipo_cuIcuName( char *s, int *param )
580
if( !strcmp( s, "Speed" ) ) {
588
static int Ipo_coIcuName( char *s, int *param )
591
if( !strcmp( s, "Inf" ) ) {
599
static int Ipo_acIcuName( char *s, int *param )
602
if( !strcmp( s, "LocX" ) ) {
606
if( !strcmp( s, "LocY" ) ) {
610
if( !strcmp( s, "LocZ" ) ) {
614
if( !strcmp( s, "SizeX" ) ) {
618
if( !strcmp( s, "SizeY" ) ) {
622
if( !strcmp( s, "SizeZ" ) ) {
626
if( !strcmp( s, "QuatX" ) ) {
630
if( !strcmp( s, "QuatY" ) ) {
634
if( !strcmp( s, "QuatZ" ) ) {
638
if( !strcmp( s, "QuatW" ) ) {
647
Camera ipo name to channel
650
static int Ipo_caIcuName( char *s, int *param )
652
/* for Camera ipos CAM_TOTNAM == CAM_TOTIPO
653
and cam_ic_names[] holds the complete set of names, so we use that.
656
extern char *cam_ic_names[];
661
for( i = 0; i < CAM_TOTIPO; i++ ) {
662
if( !strcmp( s, cam_ic_names[i] ) ) { /* found it! */
673
texture ipo name to channel
676
static int Ipo_texIcuName( char *s, int *param )
678
/* this is another case where TE_TOTIPO == TE_TOTNAM.
679
te_ic_names[] has all our names so use that.
682
extern char *tex_ic_names[];
686
for( i = 0; i < TE_TOTIPO; i++){
687
if( !strcmp( s, tex_ic_names[i] ) ){
696
static int Ipo_obIcuName( char *s, int *param )
699
if( !strcmp( s, "LocX" ) ) {
703
if( !strcmp( s, "LocY" ) ) {
707
if( !strcmp( s, "LocZ" ) ) {
711
if( !strcmp( s, "RotX" ) ) {
715
if( !strcmp( s, "RotY" ) ) {
719
if( !strcmp( s, "RotZ" ) ) {
723
if( !strcmp( s, "SizeX" ) ) {
727
if( !strcmp( s, "SizeY" ) ) {
731
if( !strcmp( s, "SizeZ" ) ) {
736
if( !strcmp( s, "dLocX" ) ) {
740
if( !strcmp( s, "dLocY" ) ) {
744
if( !strcmp( s, "dLocZ" ) ) {
748
if( !strcmp( s, "dRotX" ) ) {
752
if( !strcmp( s, "dRotY" ) ) {
756
if( !strcmp( s, "dRotZ" ) ) {
760
if( !strcmp( s, "dSizeX" ) ) {
764
if( !strcmp( s, "dSizeY" ) ) {
768
if( !strcmp( s, "dSizeZ" ) ) {
773
if( !strcmp( s, "Layer" ) ) {
777
if( !strcmp( s, "Time" ) ) {
782
if( !strcmp( s, "ColR" ) ) {
786
if( !strcmp( s, "ColG" ) ) {
790
if( !strcmp( s, "ColB" ) ) {
794
if( !strcmp( s, "ColA" ) ) {
798
if( !strcmp( s, "FStreng" ) ) {
802
if( !strcmp( s, "FFall" ) ) {
803
*param = OB_PD_FFALL;
806
if( !strcmp( s, "Damping" ) ) {
807
*param = OB_PD_SDAMP;
810
if( !strcmp( s, "RDamp" ) ) {
811
*param = OB_PD_RDAMP;
814
if( !strcmp( s, "Perm" ) ) {
898
return PyInt_FromLong( (long)i );
824
902
Function: Ipo_addCurve
944
993
if( !PyArg_ParseTuple( args, "s", &strname ) )
945
return ( EXPP_ReturnPyObjError
946
( PyExc_TypeError, "string argument" ) );
994
return EXPP_ReturnPyObjError( PyExc_TypeError,
995
"expected string argument" );
948
997
for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
949
char *str1 = getIpoCurveName( icu );
950
if( !strcmp( str1, strname ) ) {
951
BLI_remlink( &( self->ipo->curve ), icu );
953
MEM_freeN( icu->bezt );
956
allspace( REMAKEIPO, 0 );
957
EXPP_allqueue( REDRAWIPO, 0 );
959
Py_INCREF( Py_None );
998
if( !strcmp( strname, getIpoCurveName( icu ) ) ) {
999
del_ipocurve( self->ipo, icu );
964
return ( EXPP_ReturnPyObjError
965
( PyExc_RuntimeError, "IpoCurve not found" ) );
1004
return EXPP_ReturnPyObjError( PyExc_ValueError, "IpoCurve not found" );
970
1009
static PyObject *Ipo_getCurve( BPy_Ipo * self, PyObject * args )
973
1011
IpoCurve *icu = NULL;
977
if( !PyArg_ParseTuple( args, "O", &thing ) )
978
return EXPP_ReturnPyObjError(PyExc_TypeError,
979
"expected string or int argument" );
981
if(PyString_Check(thing)){
982
str = PyString_AsString(thing);
1013
PyObject *value = NULL;
1015
if( !PyArg_ParseTuple( args, "|O", &value ) )
1018
/* if no name give, get all the Ipocurves */
1020
return Ipo_getCurves( self );
1022
/* if arg is a string or int, look up the adrcode */
1023
if( PyString_Check( value ) ) {
1024
char *str = PyString_AsString( value );
983
1025
for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
984
str1 = getIpoCurveName( icu );
985
if( !strcmp( str1, str ) )
1026
if( !strcmp( str, getIpoCurveName( icu ) ) )
986
1027
return IpoCurve_CreatePyObject( icu );
988
} else if (PyInt_Check(thing)){
989
adrcode = (short)PyInt_AsLong(thing);
1031
else if( PyInt_Check( value ) ) {
1032
adrcode = ( short )PyInt_AsLong( value );
990
1033
for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
991
if(icu->adrcode == adrcode)
1034
if( icu->adrcode == adrcode )
992
1035
return IpoCurve_CreatePyObject( icu );
995
return EXPP_ReturnPyObjError(PyExc_TypeError,
996
"expected string or int argument" );
997
Py_INCREF( Py_None );
1041
return EXPP_ReturnPyObjError(PyExc_TypeError,
1042
"expected string or int argument" );
1001
1045
static PyObject *Ipo_getCurves( BPy_Ipo * self )
1003
1047
PyObject *attr = PyList_New( 0 );
1005
for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
1050
for( icu = self->ipo->curve.first; icu; icu = icu->next )
1006
1051
PyList_Append( attr, IpoCurve_CreatePyObject( icu ) );
1057
* return a list of valid curve name constants for the Ipo
1060
static PyObject *Ipo_getCurveNames( BPy_Ipo * self )
1062
namefunc lookup_name;
1067
PyObject *attr = Py_None;
1069
/* determine what type of Ipo we are */
1071
switch ( self->ipo->blocktype ) {
1073
lookup_name = (namefunc)getname_ob_ei;
1076
strcpy( name, "OB_" );
1079
lookup_name = (namefunc)getname_mat_ei;
1082
strcpy( name, "MA_" );
1085
lookup_name = (namefunc)getname_cam_ei;
1088
strcpy( name, "CA_" );
1091
lookup_name = (namefunc)getname_la_ei;
1094
strcpy( name, "LA_" );
1097
lookup_name = (namefunc)getname_tex_ei;
1100
strcpy( name, "TE_" );
1103
lookup_name = (namefunc)getname_world_ei;
1106
strcpy( name, "WO_" );
1109
lookup_name = (namefunc)getname_ac_ei;
1112
strcpy( name, "PO_" );
1115
lookup_name = (namefunc)getname_co_ei;
1118
strcpy( name, "CO_" );
1121
lookup_name = (namefunc)getname_cu_ei;
1124
strcpy( name, "CU_" );
1127
lookup_name = (namefunc)getname_seq_ei;
1130
strcpy( name, "SQ_" );
1136
/* find the ipo in the keylist */
1137
for( key = G.main->key.first; key; key = key->id.next ) {
1138
if( key->ipo == self->ipo ) {
1139
KeyBlock *block = key->block.first;
1140
attr = PyList_New( 0 );
1142
/* add each name to the list */
1143
for( block = key->block.first; block; block = block->next )
1144
PyList_Append( attr,
1145
PyString_FromString( block->name ) );
1151
/* error if the ipo isn't in the list */
1152
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
1153
"unable to find matching key data for Ipo" );
1157
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
1158
"unknown Ipo type" );
1162
* go through the list of adrcodes to find names, then add to dictionary
1163
* with string as key and adrcode as value
1166
dict = PyModule_GetDict( submodule );
1167
attr = PyConstant_New();
1171
strcpy( name+3, lookup_name( *vals ) );
1173
*ptr = (char)toupper( *ptr );
1176
PyConstant_Insert( (BPy_constant *)attr, name,
1177
PyInt_FromLong( *vals ) );
1183
void generate_curveconsts( PyObject* module )
1185
namefunc lookup_name = NULL;
1191
static short curvelist[] = {
1192
ID_OB, ID_MA, ID_CA, ID_LA, ID_TE, ID_WO, ID_PO, ID_CO, ID_CU, ID_SEQ
1195
for( i = 0; i < sizeof(curvelist)/sizeof(short); ++i ) {
1196
switch ( curvelist[i] ) {
1198
lookup_name = (namefunc)getname_ob_ei;
1201
strcpy( name, "OB_" );
1204
lookup_name = (namefunc)getname_mat_ei;
1207
strcpy( name, "MA_" );
1210
lookup_name = (namefunc)getname_cam_ei;
1213
strcpy( name, "CA_" );
1216
lookup_name = (namefunc)getname_la_ei;
1219
strcpy( name, "LA_" );
1222
lookup_name = (namefunc)getname_tex_ei;
1225
strcpy( name, "TE_" );
1228
lookup_name = (namefunc)getname_world_ei;
1231
strcpy( name, "WO_" );
1234
lookup_name = (namefunc)getname_ac_ei;
1237
strcpy( name, "PO_" );
1240
lookup_name = (namefunc)getname_co_ei;
1243
strcpy( name, "CO_" );
1246
lookup_name = (namefunc)getname_cu_ei;
1249
strcpy( name, "CU_" );
1252
lookup_name = (namefunc)getname_seq_ei;
1255
strcpy( name, "SQ_" );
1261
strcpy( name+3, lookup_name( *vals ) );
1263
*ptr = (char)toupper( *ptr );
1266
PyModule_AddIntConstant( module, name, *vals );
1274
* get the current texture channel number, if defined
1277
static PyObject *Ipo_getChannel( BPy_Ipo * self )
1279
if( self->mtex != -1 )
1280
return Py_BuildValue( "h", self->mtex );
1285
* set the current texture channel number, if defined
1288
static int Ipo_setChannel( BPy_Ipo * self, PyObject * value )
1290
if( self->mtex != -1 )
1291
return EXPP_setIValueRange( value, &self->mtex, 0, 9, 'h' );
1295
/*****************************************************************************/
1296
/* Function: Ipo_dealloc */
1297
/* Description: This is a callback function for the BPy_Ipo type. It is */
1298
/* the destructor function. */
1299
/*****************************************************************************/
1300
static void Ipo_dealloc( BPy_Ipo * self )
1302
PyObject_DEL( self );
1305
/*****************************************************************************/
1306
/* Function: Ipo_repr */
1307
/* Description: This is a callback function for the BPy_Ipo type. It */
1308
/* builds a meaningful string to represent ipo objects. */
1309
/*****************************************************************************/
1310
static PyObject *Ipo_repr( BPy_Ipo * self )
1314
switch ( self->ipo->blocktype ) {
1316
param = "Object"; break;
1318
param = "Camera"; break;
1320
param = "Lamp"; break;
1322
param = "Texture"; break;
1324
param = "World"; break;
1326
param = "Material"; break;
1328
param = "Action"; break;
1330
param = "Constriant"; break;
1332
param = "Curve"; break;
1334
param = "Sequence"; break;
1336
param = "Key"; break;
1338
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
1339
"unknown Ipo type" );
1341
return PyString_FromFormat( "[Ipo \"%s\" (%s)]", self->ipo->id.name + 2,
1345
/* Three Python Ipo_Type helper functions needed by the Object module: */
1347
/*****************************************************************************/
1348
/* Function: Ipo_CreatePyObject */
1349
/* Description: This function will create a new BPy_Ipo from an existing */
1350
/* Blender ipo structure. */
1351
/*****************************************************************************/
1352
PyObject *Ipo_CreatePyObject( Ipo * ipo )
1355
pyipo = ( BPy_Ipo * ) PyObject_NEW( BPy_Ipo, &Ipo_Type );
1357
return EXPP_ReturnPyObjError( PyExc_MemoryError,
1358
"couldn't create BPy_Ipo object" );
1361
if( pyipo->ipo->blocktype == ID_WO || pyipo->ipo->blocktype == ID_LA ||
1362
pyipo->ipo->blocktype == ID_MA )
1366
return ( PyObject * ) pyipo;
1369
/*****************************************************************************/
1370
/* Function: Ipo_CheckPyObject */
1371
/* Description: This function returns true when the given PyObject is of the */
1372
/* type Ipo. Otherwise it will return false. */
1373
/*****************************************************************************/
1374
int Ipo_CheckPyObject( PyObject * pyobj )
1376
return ( pyobj->ob_type == &Ipo_Type );
1379
/*****************************************************************************/
1380
/* Function: Ipo_FromPyObject */
1381
/* Description: This function returns the Blender ipo from the given */
1383
/*****************************************************************************/
1384
Ipo *Ipo_FromPyObject( PyObject * pyobj )
1386
return ( ( BPy_Ipo * ) pyobj )->ipo;
1389
/*****************************************************************************/
1390
/* Function: Ipo_length */
1391
/* Description: This function counts the number of curves accessible for the */
1393
/*****************************************************************************/
1394
static int Ipo_length( BPy_Ipo * self )
1399
for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
1400
if( self->mtex == -1 || icu->adrcode < MA_MAP1 ||
1401
icu->adrcode & texchannel_to_adrcode( self->mtex ) )
1408
* "mapping" operator getter: return an IpoCurve it we can find it
1411
static PyObject *Ipo_getIpoCurveByName( BPy_Ipo * self, PyObject * key )
1413
IpoCurve *icu = NULL;
1416
/* if Ipo is not ShapeKey and arg is an int, look up the adrcode */
1417
if( self->ipo->blocktype != ID_KE && PyNumber_Check( key ) )
1418
adrcode = lookup_curve_adrcode( PyInt_AsLong( key ),
1419
self->ipo->blocktype, self->mtex );
1420
/* if Ipo is ShapeKey and arg is string, look up the adrcode */
1421
else if( self->ipo->blocktype == ID_KE && PyString_Check( key ) ) {
1422
adrcode = lookup_curve_key( PyString_AS_STRING( key ), self->ipo );
1424
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
1425
"unable to find matching key data for Ipo" );
1428
return EXPP_ReturnPyObjError( PyExc_TypeError,
1429
"expected int or string key" );
1431
/* if no adrcode found, value error */
1433
return EXPP_ReturnPyObjError( PyExc_KeyError, "invalid curve key" );
1435
/* search for a matching adrcode */
1436
for( icu = self->ipo->curve.first; icu; icu = icu->next )
1437
if( icu->adrcode == adrcode )
1438
return IpoCurve_CreatePyObject( icu );
1440
/* no curve found */
1445
* "mapping" operator setter: create or delete an IpoCurve it we can find it
1448
static int Ipo_setIpoCurveByName( BPy_Ipo * self, PyObject * key,
1452
Ipo *ipo = self->ipo;
1455
/* "del ipo[const]" will send NULL here; give an error */
1457
return EXPP_ReturnIntError( PyExc_NotImplementedError,
1458
"del operator not supported" );
1460
/* "del ipo[const]" will send NULL here; give an error */
1461
if( self->ipo->blocktype == ID_KE )
1462
return EXPP_ReturnIntError( PyExc_TypeError,
1463
"creation or deletion of Shape Keys not supported" );
1465
/* check for int argument */
1466
if( !PyNumber_Check( key ) )
1467
return EXPP_ReturnIntError( PyExc_TypeError, "expected int key" );
1469
/* look up the key, return error if not found */
1470
adrcode = lookup_curve_adrcode( PyInt_AsLong( key ),
1471
self->ipo->blocktype, self->mtex );
1474
return EXPP_ReturnIntError( PyExc_KeyError,
1475
"invalid curve specified" );
1477
/* if arg is None, delete the curve */
1478
if( arg == Py_None ) {
1479
for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
1480
if( icu->adrcode == adrcode ) {
1481
del_ipocurve( ipo, icu );
1486
return EXPP_ReturnIntError( PyExc_ValueError, "IpoCurve not found" );
1489
/* create the new ipo curve */
1491
PyObject *tmp, *flt=NULL, *val=NULL;
1493
/* error if not a sequence or sequence with other than 2 values */
1494
if( PySequence_Size( arg ) != 2 )
1497
/* get the time and curval */
1498
tmp = PySequence_ITEM( arg, 0 );
1499
flt = PyNumber_Float( tmp );
1501
tmp = PySequence_ITEM( arg, 1 );
1502
val = PyNumber_Float( tmp );
1508
time = (float)PyFloat_AS_DOUBLE( flt );
1509
curval = (float)PyFloat_AS_DOUBLE( val );
1513
/* if curve already exist, delete the original */
1514
for( icu = ipo->curve.first; icu; icu = icu->next )
1515
if( icu->adrcode == adrcode ) {
1516
del_ipocurve( ipo, icu );
1520
/* create the new curve, then add the key */
1521
icu = MEM_callocN( sizeof(IpoCurve), "Python added ipocurve");
1522
icu->blocktype = ipo->blocktype;
1523
icu->adrcode = adrcode;
1524
icu->flag |= IPO_VISIBLE|IPO_AUTO_HORIZ;
1525
set_icu_vars( icu );
1526
BLI_addtail( &(ipo->curve), icu);
1527
insert_vert_ipo( icu, time, curval );
1529
allspace( REMAKEIPO, 0 );
1530
EXPP_allqueue( REDRAWIPO, 0 );
1537
return EXPP_ReturnIntError( PyExc_AttributeError,
1538
"expected sequence of two floats" );
1543
* sequence __contains__ method (implements "x in ipo")
1546
static int Ipo_contains( BPy_Ipo *self, PyObject *key )
1548
IpoCurve *icu = NULL;
1551
/* take a Ipo curve name: key must be a int */
1553
if( self->ipo->blocktype != ID_KE && PyNumber_Check( key ) ) {
1554
adrcode = lookup_curve_adrcode( PyInt_AsLong( key ),
1555
self->ipo->blocktype, self->mtex );
1557
/* if we found an adrcode for the key, search the ipo's curve */
1558
if( adrcode != -1 ) {
1559
for( icu = self->ipo->curve.first; icu; icu = icu->next )
1560
if( icu->adrcode == adrcode )
1563
} else if( self->ipo->blocktype == ID_KE && PyString_Check( key ) ) {
1564
adrcode = lookup_curve_key( PyString_AS_STRING( key ), self->ipo );
1566
/* if we found an adrcode for the key, search the ipo's curve */
1567
if( adrcode >= 0 ) {
1568
for( icu = self->ipo->curve.first; icu; icu = icu->next )
1569
if( icu->adrcode == adrcode )
1574
/* no curve found */
1579
* Initialize the interator index
1582
static PyObject *Ipo_getIter( BPy_Ipo * self )
1585
return EXPP_incr_ret ( (PyObject *) self );
1589
* Get the next Ipo curve
1592
static PyObject *Ipo_nextIter( BPy_Ipo * self )
1595
IpoCurve *icu = self->ipo->curve.first;
1600
* count curves only if
1601
* (a) Ipo has no texture channels
1602
* (b) Ipo has texture channels, but curve is not that type
1603
* (c) Ipo has texture channels, and curve is that type, and it is
1604
* in the active texture channel
1606
for( i = 0; icu; icu = icu->next ) {
1607
if( self->mtex == -1 || icu->adrcode < MA_MAP1 ||
1608
icu->adrcode & texchannel_to_adrcode( self->mtex ) ) {
1611
/* if indices match, return the curve */
1612
if( i == self->iter )
1613
return IpoCurve_CreatePyObject( icu );
1617
/* ran out of curves */
1618
return EXPP_ReturnPyObjError( PyExc_StopIteration,
1619
"iterator at end" );
1622
/*****************************************************************************/
1623
/* Function: Ipo_Init */
1624
/*****************************************************************************/
1625
PyObject *Ipo_Init( void )
1627
// PyObject *submodule;
1629
if( PyType_Ready( &Ipo_Type ) < 0 )
1632
submodule = Py_InitModule3( "Blender.Ipo", M_Ipo_methods, M_Ipo_doc );
1633
generate_curveconsts( submodule );
1639
* The following methods should be deprecated when there are equivalent
1640
* methods in Ipocurve (if there aren't already).
1012
1643
static PyObject *Ipo_getNBezPoints( BPy_Ipo * self, PyObject * args )
1646
IpoCurve *icu = NULL;
1016
1648
if( !PyArg_ParseTuple( args, "i", &num ) )
1017
return ( EXPP_ReturnPyObjError
1018
( PyExc_TypeError, "expected int argument" ) );
1649
return EXPP_ReturnPyObjError( PyExc_TypeError,
1650
"expected int argument" );
1019
1652
icu = self->ipo->curve.first;
1021
return ( EXPP_ReturnPyObjError
1022
( PyExc_TypeError, "No IPO curve" ) );
1023
for( i = 0; i < num; i++ ) {
1025
return ( EXPP_ReturnPyObjError
1026
( PyExc_TypeError, "Bad curve number" ) );
1653
while( icu && num > 0 ) {
1027
1654
icu = icu->next;
1030
return ( PyInt_FromLong( icu->totvert ) );
1658
if( num < 0 && !icu )
1659
return EXPP_ReturnPyObjError( PyExc_IndexError,
1660
"index out of range" );
1662
return PyInt_FromLong( icu->totvert );
1033
1665
static PyObject *Ipo_DeleteBezPoints( BPy_Ipo * self, PyObject * args )
1258
1850
return Py_None;
1262
/*****************************************************************************/
1263
/* Function: IpoDeAlloc */
1264
/* Description: This is a callback function for the BPy_Ipo type. It is */
1265
/* the destructor function. */
1266
/*****************************************************************************/
1267
static void IpoDeAlloc( BPy_Ipo * self )
1269
PyObject_DEL( self );
1272
/*****************************************************************************/
1273
/* Function: IpoGetAttr */
1274
/* Description: This is a callback function for the BPy_Ipo type. It is */
1275
/* the function that accesses BPy_Ipo "member variables" and */
1277
/*****************************************************************************/
1278
static PyObject *IpoGetAttr( BPy_Ipo * self, char *name )
1280
if( strcmp( name, "curves" ) == 0 )
1281
return Ipo_getCurves( self );
1282
return Py_FindMethod( BPy_Ipo_methods, ( PyObject * ) self, name );
1285
/*****************************************************************************/
1286
/* Function: IpoSetAttr */
1287
/* Description: This is a callback function for the BPy_Ipo type. It is the */
1288
/* function that sets Ipo Data attributes (member variables).*/
1289
/*****************************************************************************/
1290
static int IpoSetAttr( BPy_Ipo * self, char *name, PyObject * value )
1292
return 0; /* normal exit */
1295
/*****************************************************************************/
1296
/* Function: IpoRepr */
1297
/* Description: This is a callback function for the BPy_Ipo type. It */
1298
/* builds a meaninful string to represent ipo objects. */
1299
/*****************************************************************************/
1300
static PyObject *IpoRepr( BPy_Ipo * self )
1302
return PyString_FromFormat( "[Ipo \"%s\" %d]", self->ipo->id.name + 2,
1303
self->ipo->blocktype );
1306
/* Three Python Ipo_Type helper functions needed by the Object module: */
1308
/*****************************************************************************/
1309
/* Function: Ipo_CreatePyObject */
1310
/* Description: This function will create a new BPy_Ipo from an existing */
1311
/* Blender ipo structure. */
1312
/*****************************************************************************/
1313
PyObject *Ipo_CreatePyObject( Ipo * ipo )
1316
pyipo = ( BPy_Ipo * ) PyObject_NEW( BPy_Ipo, &Ipo_Type );
1318
return EXPP_ReturnPyObjError( PyExc_MemoryError,
1319
"couldn't create BPy_Ipo object" );
1321
return ( PyObject * ) pyipo;
1324
/*****************************************************************************/
1325
/* Function: Ipo_CheckPyObject */
1326
/* Description: This function returns true when the given PyObject is of the */
1327
/* type Ipo. Otherwise it will return false. */
1328
/*****************************************************************************/
1329
int Ipo_CheckPyObject( PyObject * pyobj )
1331
return ( pyobj->ob_type == &Ipo_Type );
1334
/*****************************************************************************/
1335
/* Function: Ipo_FromPyObject */
1336
/* Description: This function returns the Blender ipo from the given */
1338
/*****************************************************************************/
1339
Ipo *Ipo_FromPyObject( PyObject * pyobj )
1341
return ( ( BPy_Ipo * ) pyobj )->ipo;
1854
* The following methods should be deprecated when methods are pruned out.
1857
static PyObject *Ipo_oldsetRctf( BPy_Ipo * self, PyObject * args )
1859
return EXPP_setterWrapperTuple( (void *)self, args,
1860
(setter)Ipo_setRctf );
1863
static PyObject *Ipo_oldsetName( BPy_Ipo * self, PyObject * args )
1865
return EXPP_setterWrapperTuple( (void *)self, args,
1866
(setter)Ipo_setName );
1869
static PyObject *Ipo_oldsetBlocktype( BPy_Ipo * self, PyObject * args )
1871
return EXPP_setterWrapperTuple( (void *)self, args,
1872
(setter)Ipo_setBlocktype );