2
* $Id: Lattice.c 14456 2008-04-17 21:14:55Z campbellbarton $
4
* ***** BEGIN GPL LICENSE BLOCK *****
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software Foundation,
18
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21
* All rights reserved.
23
* This is a new part of Blender.
25
* Contributor(s): Joseph Gilbert
27
* ***** END GPL LICENSE BLOCK *****
30
#include "Lattice.h" /*This must come first*/
32
#include "BKE_utildefines.h"
34
#include "BKE_global.h"
35
#include "BKE_library.h"
36
#include "BKE_lattice.h"
37
#include "BLI_blenlib.h"
38
#include "DNA_object_types.h"
39
#include "DNA_key_types.h"
40
#include "DNA_mesh_types.h"
41
#include "DNA_meshdata_types.h"
42
#include "DNA_curve_types.h"
43
#include "DNA_scene_types.h"
44
#include "BIF_editkey.h"
45
#include "BIF_editdeform.h"
46
#include "BIF_space.h"
48
#include "gen_utils.h"
49
#include "gen_library.h"
53
/*****************************************************************************/
54
/* Python API function prototypes for the Lattice module. */
55
/*****************************************************************************/
56
static PyObject *M_Lattice_New( PyObject * self, PyObject * args );
57
static PyObject *M_Lattice_Get( PyObject * self, PyObject * args );
59
/*****************************************************************************/
60
/* Lattice Module strings */
61
/* The following string definitions are used for documentation strings. */
62
/* In Python these will be written to the console when doing a */
63
/* Blender.Lattice.__doc__ */
64
/*****************************************************************************/
65
static char M_Lattice_doc[] = "The Blender Lattice module\n\n";
67
static char M_Lattice_New_doc[] = "() - return a new Lattice object";
69
static char M_Lattice_Get_doc[] = "() - get a Lattice from blender";
71
/*****************************************************************************/
72
/* Python method structure definition for Blender.Lattice module: */
73
/*****************************************************************************/
74
struct PyMethodDef M_Lattice_methods[] = {
75
{"New", ( PyCFunction ) M_Lattice_New, METH_VARARGS,
77
{"Get", ( PyCFunction ) M_Lattice_Get, METH_VARARGS,
83
/*****************************************************************************/
85
/* The following string definitions are used for documentation strings. */
86
/* In Python these will be written to the console when doing a */
87
/* Blender.Lattice.__doc__ */
88
/*****************************************************************************/
89
static char Lattice_getName_doc[] = "() - Return Lattice Object name";
91
static char Lattice_setName_doc[] = "(str) - Change Lattice Object name";
93
static char Lattice_setPartitions_doc[] =
94
"(str) - Set the number of Partitions in x,y,z";
96
static char Lattice_getPartitions_doc[] =
97
"(str) - Get the number of Partitions in x,y,z";
99
static char Lattice_getKey_doc[] =
100
"() - Get the Key object attached to this Lattice";
102
static char Lattice_setKeyTypes_doc[] =
103
"(str) - Set the key types for x,y,z dimensions";
105
static char Lattice_getKeyTypes_doc[] =
106
"(str) - Get the key types for x,y,z dimensions";
108
static char Lattice_setMode_doc[] = "(str) - Make an outside or grid lattice";
110
static char Lattice_getMode_doc[] = "(str) - Get lattice mode type";
112
static char Lattice_setPoint_doc[] =
113
"(str) - Set the coordinates of a point on the lattice";
115
static char Lattice_getPoint_doc[] =
116
"(str) - Get the coordinates of a point on the lattice";
118
static char Lattice_insertKey_doc[] =
119
"(str) - Set a new key for the lattice at specified frame";
121
static char Lattice_copy_doc[] =
122
"() - Return a copy of the lattice.";
124
//***************************************************************************
125
// Function: Lattice_CreatePyObject
126
//***************************************************************************
127
PyObject *Lattice_CreatePyObject( Lattice * lt )
131
pyLat = ( BPy_Lattice * ) PyObject_NEW( BPy_Lattice, &Lattice_Type );
134
return EXPP_ReturnPyObjError( PyExc_MemoryError,
135
"couldn't create BPy_Lattice PyObject" );
139
return ( PyObject * ) pyLat;
142
//***************************************************************************
143
// Function: Lattice_FromPyObject
144
//***************************************************************************
146
Lattice *Lattice_FromPyObject( PyObject * pyobj )
148
return ( ( BPy_Lattice * ) pyobj )->lattice;
151
//***************************************************************************
152
// Function: M_Lattice_New
153
// Python equivalent: Blender.Lattice.New
154
//***************************************************************************
155
static PyObject *M_Lattice_New( PyObject * self, PyObject * args )
158
Lattice *bl_Lattice; // blender Lattice object
159
PyObject *py_Lattice; // python wrapper
161
if( !PyArg_ParseTuple( args, "|s", &name ) )
162
return EXPP_ReturnPyObjError( PyExc_AttributeError,
163
"expected string and int arguments (or nothing)" );
165
bl_Lattice = add_lattice( "Lattice" );
168
bl_Lattice->id.us = 0;
169
py_Lattice = Lattice_CreatePyObject( bl_Lattice );
171
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
172
"couldn't create Lattice Object in Blender" );
174
return EXPP_ReturnPyObjError( PyExc_MemoryError,
175
"couldn't create Lattice Object wrapper" );
178
rename_id( &bl_Lattice->id, name );
183
//***************************************************************************
184
// Function: M_Lattice_Get
185
// Python equivalent: Blender.Lattice.Get
186
//***************************************************************************
187
static PyObject *M_Lattice_Get( PyObject * self, PyObject * args )
192
if( !PyArg_ParseTuple( args, "|s", &name ) )
193
return ( EXPP_ReturnPyObjError( PyExc_TypeError,
194
"expected string argument (or nothing)" ) );
196
lat_iter = G.main->latt.first;
198
if( name ) { /* (name) - Search Lattice by name */
200
PyObject *wanted_lat = NULL;
202
while( ( lat_iter ) && ( wanted_lat == NULL ) ) {
203
if( strcmp( name, lat_iter->id.name + 2 ) == 0 ) {
205
Lattice_CreatePyObject( lat_iter );
208
lat_iter = lat_iter->id.next;
211
if( wanted_lat == NULL ) { /* Requested Lattice doesn't exist */
213
PyOS_snprintf( error_msg, sizeof( error_msg ),
214
"Lattice \"%s\" not found", name );
215
return ( EXPP_ReturnPyObjError
216
( PyExc_NameError, error_msg ) );
222
else { /* () - return a list of all Lattices in the scene */
224
PyObject *latlist, *pyobj;
226
latlist = PyList_New( BLI_countlist( &( G.main->latt ) ) );
228
if( latlist == NULL )
229
return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
230
"couldn't create PyList" ) );
233
pyobj = Lattice_CreatePyObject( lat_iter );
237
return ( EXPP_ReturnPyObjError
239
"couldn't create PyString" ) );
241
PyList_SET_ITEM( latlist, index, pyobj );
243
lat_iter = lat_iter->id.next;
251
//***************************************************************************
252
// Function: Lattice_Init
253
//***************************************************************************
254
PyObject *Lattice_Init( void )
259
if( PyType_Ready( &Lattice_Type ) < 0 )
262
mod = Py_InitModule3( "Blender.Lattice", M_Lattice_methods,
265
dict = PyModule_GetDict( mod );
268
#define EXPP_ADDCONST(x) EXPP_dict_set_item_str(dict, #x, PyInt_FromLong(LT_##x))
269
EXPP_ADDCONST( GRID );
270
EXPP_ADDCONST( OUTSIDE );
273
#define EXPP_ADDCONST(x) EXPP_dict_set_item_str(dict, #x, PyInt_FromLong(KEY_##x))
274
EXPP_ADDCONST( LINEAR );
275
EXPP_ADDCONST( CARDINAL );
276
EXPP_ADDCONST( BSPLINE );
281
static PyObject *Lattice_setPartitions( BPy_Lattice * self, PyObject * args )
288
if( !PyArg_ParseTuple( args, "iii", &x, &y, &z ) )
289
return ( EXPP_ReturnPyObjError( PyExc_TypeError,
290
"expected int,int,int argument" ) );
292
bl_Lattice = self->lattice;
294
if( x < 2 || y < 2 || z < 2 )
295
return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
296
"partition values must be 2 or greater" ) );
298
resizelattice(bl_Lattice, x, y, z, NULL);
303
static PyObject *Lattice_getPartitions( BPy_Lattice * self )
306
bl_Lattice = self->lattice;
308
return Py_BuildValue( "[i,i,i]", ( int ) bl_Lattice->pntsu,
309
( int ) bl_Lattice->pntsv,
310
( int ) bl_Lattice->pntsw );
313
static PyObject *Lattice_getKey( BPy_Lattice * self )
315
Key *key = self->lattice->key;
318
return Key_CreatePyObject(key);
323
static PyObject *Lattice_getKeyTypes( BPy_Lattice * self )
326
char *linear = "linear";
327
char *cardinal = "cardinal";
328
char *bspline = "bspline";
329
char *s_x = NULL, *s_y = NULL, *s_z = NULL;
331
bl_Lattice = self->lattice;
333
if( ( bl_Lattice->typeu ) == KEY_LINEAR )
335
else if( ( bl_Lattice->typeu ) == KEY_CARDINAL )
337
else if( ( bl_Lattice->typeu ) == KEY_BSPLINE )
340
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
343
if( ( bl_Lattice->typev ) == KEY_LINEAR )
345
else if( ( bl_Lattice->typev ) == KEY_CARDINAL )
347
else if( ( bl_Lattice->typev ) == KEY_BSPLINE )
350
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
353
if( ( bl_Lattice->typew ) == KEY_LINEAR )
355
else if( ( bl_Lattice->typew ) == KEY_CARDINAL )
357
else if( ( bl_Lattice->typew ) == KEY_BSPLINE )
360
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
363
/* we made sure no s_[xyz] is NULL */
364
return Py_BuildValue( "[s,s,s]", s_x, s_y, s_z );
367
static PyObject *Lattice_setKeyTypes( BPy_Lattice * self, PyObject * args )
374
if( !PyArg_ParseTuple( args, "iii", &x, &y, &z ) )
375
return ( EXPP_ReturnPyObjError( PyExc_TypeError,
376
"expected int,int,int argument" ) );
378
bl_Lattice = self->lattice;
380
if( x == KEY_LINEAR )
381
bl_Lattice->typeu = KEY_LINEAR;
382
else if( x == KEY_CARDINAL )
383
bl_Lattice->typeu = KEY_CARDINAL;
384
else if( x == KEY_BSPLINE )
385
bl_Lattice->typeu = KEY_BSPLINE;
387
return EXPP_ReturnPyObjError( PyExc_TypeError,
388
"type must be LINEAR, CARDINAL OR BSPLINE" );
390
if( y == KEY_LINEAR )
391
bl_Lattice->typev = KEY_LINEAR;
392
else if( y == KEY_CARDINAL )
393
bl_Lattice->typev = KEY_CARDINAL;
394
else if( y == KEY_BSPLINE )
395
bl_Lattice->typev = KEY_BSPLINE;
397
return EXPP_ReturnPyObjError( PyExc_TypeError,
398
"type must be LINEAR, CARDINAL OR BSPLINE" );
400
if( z == KEY_LINEAR )
401
bl_Lattice->typew = KEY_LINEAR;
402
else if( z == KEY_CARDINAL )
403
bl_Lattice->typew = KEY_CARDINAL;
404
else if( z == KEY_BSPLINE )
405
bl_Lattice->typew = KEY_BSPLINE;
407
return EXPP_ReturnPyObjError( PyExc_TypeError,
408
"type must be LINEAR, CARDINAL OR BSPLINE" );
413
static PyObject *Lattice_setMode( BPy_Lattice * self, PyObject * args )
417
bl_Lattice = self->lattice;
419
if( !PyArg_ParseTuple( args, "h", &type ) )
420
return ( EXPP_ReturnPyObjError( PyExc_TypeError,
421
"expected int argument" ) );
423
if( type == LT_GRID )
424
bl_Lattice->flag = LT_GRID;
425
else if( type == LT_OUTSIDE ) {
426
bl_Lattice->flag = LT_OUTSIDE + LT_GRID;
427
outside_lattice( bl_Lattice );
429
return EXPP_ReturnPyObjError( PyExc_TypeError,
430
"type must be either GRID or OUTSIDE" );
435
static PyObject *Lattice_getMode(BPy_Lattice * self)
437
if( self->lattice->flag == 1 )
438
return PyString_FromString( "Grid" );
439
else if( self->lattice->flag == 3 )
440
return PyString_FromString( "Outside" );
444
static PyObject *Lattice_setPoint( BPy_Lattice * self, PyObject * args )
451
PyObject *listObject;
453
if( !PyArg_ParseTuple
454
( args, "iO!", &index, &PyList_Type, &listObject ) )
455
return ( EXPP_ReturnPyObjError
456
( PyExc_TypeError, "expected int & list argument" ) );
458
if( !PyList_Check( listObject ) )
459
return ( EXPP_ReturnPyObjError( PyExc_TypeError,
460
"2nd parameter should be a python list" ) );
462
if( !( PyList_Size( listObject ) == 3 ) )
463
return ( EXPP_ReturnPyObjError( PyExc_TypeError,
464
"Please pass 3 parameters in the list [x,y,z]" ) );
468
bl_Lattice = self->lattice;
471
bp = bl_Lattice->def;
474
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
475
"no lattice points!" ) );
477
//calculate size of lattice
478
size = bl_Lattice->pntsu * bl_Lattice->pntsv * bl_Lattice->pntsw;
480
if( index < 0 || index > size )
481
return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
482
"index outside of lattice size!" ) );
491
for( x = 0; x < PyList_Size( listObject ); x++ ) {
494
( ( PyList_GetItem( listObject, x ) ), "f",
496
return EXPP_ReturnPyObjError( PyExc_TypeError,
497
"python list integer not parseable" );
498
bpoint->vec[x] = tempInt;
504
static PyObject *Lattice_getPoint( BPy_Lattice * self, PyObject * args )
511
if( !PyArg_ParseTuple( args, "i", &index ) )
512
return ( EXPP_ReturnPyObjError( PyExc_TypeError,
513
"expected int argument" ) );
517
bl_Lattice = self->lattice;
520
bp = bl_Lattice->def;
523
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
524
"no lattice points!" ) );
526
//calculate size of lattice
527
size = bl_Lattice->pntsu * bl_Lattice->pntsv * bl_Lattice->pntsw;
529
if( index < 0 || index > size )
530
return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
531
"index outside of lattice size!" ) );
541
return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
542
"bpoint does not exist" ) );
544
return Py_BuildValue( "[f,f,f]", bp->vec[0], bp->vec[1], bp->vec[2] );
547
static PyObject *Lattice_insertKey( BPy_Lattice * self, PyObject * args )
550
int frame = -1, oldfra = -1;
552
if( !PyArg_ParseTuple( args, "i", &frame ) )
553
return ( EXPP_ReturnPyObjError( PyExc_TypeError,
554
"expected int argument" ) );
558
//set the current frame
560
frame = EXPP_ClampInt( frame, 1, MAXFRAME );
561
oldfra = G.scene->r.cfra;
562
G.scene->r.cfra = (int)frame;
564
// else just use current frame, then
565
// return (EXPP_ReturnPyObjError (PyExc_RuntimeError,
566
// "frame value has to be greater than 0"));
568
//insert a keybock for the lattice (1=relative)
569
insert_lattkey( lt , 1);
570
allspace(REMAKEIPO, 0);
573
G.scene->r.cfra = (int)oldfra;
578
static PyObject *Lattice_copy( BPy_Lattice * self )
580
Lattice *bl_Lattice; // blender Lattice object
581
PyObject *py_Lattice; // python wrapper
583
bl_Lattice = copy_lattice( self->lattice );
584
bl_Lattice->id.us = 0;
587
py_Lattice = Lattice_CreatePyObject( bl_Lattice );
589
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
590
"couldn't create Lattice Object in Blender" );
592
return EXPP_ReturnPyObjError( PyExc_MemoryError,
593
"couldn't create Lattice Object wrapper" );
598
static int Lattice_compare( BPy_Lattice * a, BPy_Lattice * b )
600
return ( a->lattice == b->lattice ) ? 0 : -1;
604
//***************************************************************************
605
// Function: Lattice_repr
606
// Description: This is a callback function for the BPy_Lattice type. It
607
// builds a meaninful string to represent Lattice objects.
608
//***************************************************************************
609
static PyObject *Lattice_repr( BPy_Lattice * self )
612
return PyString_FromFormat( "[Lattice \"%s\"]",
613
self->lattice->id.name + 2 );
615
return PyString_FromString( "[Lattice <deleted>]" );
618
/*****************************************************************************/
619
/* Python BPy_Lattice methods table: */
620
/*****************************************************************************/
621
static PyMethodDef BPy_Lattice_methods[] = {
622
/* name, method, flags, doc */
623
{"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
624
Lattice_getName_doc},
625
{"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
626
Lattice_setName_doc},
627
{"setPartitions", ( PyCFunction ) Lattice_setPartitions, METH_VARARGS,
628
Lattice_setPartitions_doc},
629
{"getPartitions", ( PyCFunction ) Lattice_getPartitions, METH_NOARGS,
630
Lattice_getPartitions_doc},
631
{"getKey", ( PyCFunction ) Lattice_getKey, METH_NOARGS,
633
{"setKeyTypes", ( PyCFunction ) Lattice_setKeyTypes, METH_VARARGS,
634
Lattice_setKeyTypes_doc},
635
{"getKeyTypes", ( PyCFunction ) Lattice_getKeyTypes, METH_NOARGS,
636
Lattice_getKeyTypes_doc},
637
{"setMode", ( PyCFunction ) Lattice_setMode, METH_VARARGS,
638
Lattice_setMode_doc},
639
{"getMode", ( PyCFunction ) Lattice_getMode, METH_NOARGS,
640
Lattice_getMode_doc},
641
{"setPoint", ( PyCFunction ) Lattice_setPoint, METH_VARARGS,
642
Lattice_setPoint_doc},
643
{"getPoint", ( PyCFunction ) Lattice_getPoint, METH_VARARGS,
644
Lattice_getPoint_doc},
645
{"insertKey", ( PyCFunction ) Lattice_insertKey, METH_VARARGS,
646
Lattice_insertKey_doc},
647
{"__copy__", ( PyCFunction ) Lattice_copy, METH_NOARGS,
649
{"copy", ( PyCFunction ) Lattice_copy, METH_NOARGS,
651
{NULL, NULL, 0, NULL}
654
/*****************************************************************************/
655
/* Python attributes get/set functions: */
656
/*****************************************************************************/
657
static PyObject *Lattice_getWidth(BPy_Lattice * self)
659
return PyInt_FromLong( self->lattice->pntsu );
661
static PyObject *Lattice_getHeight(BPy_Lattice * self)
663
return PyInt_FromLong( self->lattice->pntsv );
665
static PyObject *Lattice_getDepth(BPy_Lattice * self)
667
return PyInt_FromLong( self->lattice->pntsw );
669
static PyObject *Lattice_getLatSize(BPy_Lattice * self)
671
return PyInt_FromLong(
672
self->lattice->pntsu * self->lattice->pntsv * self->lattice->pntsw );
676
static PyObject *Lattice_getAxisType(BPy_Lattice * self, void * type)
678
char interp_type = 0;
679
switch ( GET_INT_FROM_POINTER(type) ) {
681
interp_type = self->lattice->typeu;
684
interp_type = self->lattice->typev;
687
interp_type = self->lattice->typew;
691
switch (interp_type) {
693
return PyString_FromString( "Linear" );
695
return PyString_FromString( "Cardinal" );
697
return PyString_FromString( "Bspline" );
702
/*****************************************************************************/
703
/* Python attributes get/set structure: */
704
/*****************************************************************************/
705
static PyGetSetDef BPy_Lattice_getseters[] = {
706
GENERIC_LIB_GETSETATTR,
707
{"width", (getter)Lattice_getWidth, (setter)NULL,
708
"lattice U subdivision ", NULL},
709
{"height", (getter)Lattice_getHeight, (setter)NULL,
710
"lattice V subdivision", NULL},
711
{"depth", (getter)Lattice_getDepth, (setter)NULL,
712
"lattice W subdivision", NULL},
713
{"latSize", (getter)Lattice_getLatSize, (setter)NULL,
714
"lattice W subdivision", NULL},
716
{"widthType", (getter)Lattice_getAxisType, NULL,
717
"lattice U interpolation type", (void *)0},
718
{"heightType", (getter)Lattice_getAxisType, NULL,
719
"lattice V interpolation type", (void *)1},
720
{"depthType", (getter)Lattice_getAxisType, NULL,
721
"lattice W interpolation type", (void *)2},
723
{"key", (getter)Lattice_getKey, NULL,
724
"lattice key", NULL},
725
{"mode", (getter)Lattice_getMode, NULL,
726
"lattice key", NULL},
727
{NULL,NULL,NULL,NULL,NULL} /* Sentinel */
730
/*****************************************************************************/
731
/* Python Lattice_Type structure definition: */
732
/*****************************************************************************/
733
PyTypeObject Lattice_Type = {
734
PyObject_HEAD_INIT( NULL )
736
"Blender Lattice", /* tp_name */
737
sizeof( BPy_Lattice ), /* tp_basicsize */
740
NULL, /* tp_dealloc */
742
NULL, /* tp_getattr */
743
NULL, /* tp_setattr */
744
( cmpfunc ) Lattice_compare, /* tp_compare */
745
( reprfunc ) Lattice_repr, /* tp_repr */
747
/* Method suites for standard classes */
749
NULL, /* PyNumberMethods *tp_as_number; */
750
NULL, /* PySequenceMethods *tp_as_sequence; */
751
NULL, /* PyMappingMethods *tp_as_mapping; */
753
/* More standard operations (here for binary compatibility) */
755
( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
756
NULL, /* ternaryfunc tp_call; */
757
NULL, /* reprfunc tp_str; */
758
NULL, /* getattrofunc tp_getattro; */
759
NULL, /* setattrofunc tp_setattro; */
761
/* Functions to access object as input/output buffer */
762
NULL, /* PyBufferProcs *tp_as_buffer; */
764
/*** Flags to define presence of optional/expanded features ***/
765
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
767
NULL, /* char *tp_doc; Documentation string */
768
/*** Assigned meaning in release 2.0 ***/
769
/* call function for all accessible objects */
770
NULL, /* traverseproc tp_traverse; */
772
/* delete references to contained objects */
773
NULL, /* inquiry tp_clear; */
775
/*** Assigned meaning in release 2.1 ***/
776
/*** rich comparisons ***/
777
NULL, /* richcmpfunc tp_richcompare; */
779
/*** weak reference enabler ***/
780
0, /* long tp_weaklistoffset; */
782
/*** Added in release 2.2 ***/
784
NULL, /* getiterfunc tp_iter; */
785
NULL, /* iternextfunc tp_iternext; */
787
/*** Attribute descriptor and subclassing stuff ***/
788
BPy_Lattice_methods, /* struct PyMethodDef *tp_methods; */
789
NULL, /* struct PyMemberDef *tp_members; */
790
BPy_Lattice_getseters, /* struct PyGetSetDef *tp_getset; */
791
NULL, /* struct _typeobject *tp_base; */
792
NULL, /* PyObject *tp_dict; */
793
NULL, /* descrgetfunc tp_descr_get; */
794
NULL, /* descrsetfunc tp_descr_set; */
795
0, /* long tp_dictoffset; */
796
NULL, /* initproc tp_init; */
797
NULL, /* allocfunc tp_alloc; */
798
NULL, /* newfunc tp_new; */
799
/* Low-level free-memory routine */
800
NULL, /* freefunc tp_free; */
801
/* For PyObject_IS_GC */
802
NULL, /* inquiry tp_is_gc; */
803
NULL, /* PyObject *tp_bases; */
804
/* method resolution order */
805
NULL, /* PyObject *tp_mro; */
806
NULL, /* PyObject *tp_cache; */
807
NULL, /* PyObject *tp_subclasses; */
808
NULL, /* PyObject *tp_weaklist; */