33
34
#define EXPP_Lattice_H
35
36
#include <Python.h>
37
#include <BKE_global.h>
38
#include <BKE_library.h>
39
#include <BKE_lattice.h>
40
#include <BKE_utildefines.h>
42
#include <BLI_blenlib.h>
43
37
#include <DNA_lattice_types.h>
44
#include <DNA_key_types.h>
45
#include <BIF_editlattice.h>
46
#include <BIF_editkey.h>
50
#include "gen_utils.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
/* The following string definitions are used for documentation strings. */
61
/* In Python these will be written to the console when doing a */
62
/* Blender.Lattice.__doc__ Lattice Module strings */
63
/*****************************************************************************/
64
static char M_Lattice_doc[] =
65
"The Blender Lattice module\n\n";
67
static char M_Lattice_New_doc[] =
68
"() - return a new Lattice object";
70
static char M_Lattice_Get_doc[] =
71
"() - geta a Lattice from blender";
73
/*****************************************************************************/
74
/* Python method structure definition for Blender.Lattice module: */
75
/*****************************************************************************/
76
struct PyMethodDef M_Lattice_methods[] = {
77
{"New",(PyCFunction)M_Lattice_New, METH_VARARGS,
79
{"Get",(PyCFunction)M_Lattice_Get, METH_VARARGS,
84
/*****************************************************************************/
85
/* Python BPy_Lattice structure definition: */
41
/*****************************************************************************/
42
/* Python BPy_Lattice structure definition: */
86
43
/*****************************************************************************/
45
PyObject_HEAD Lattice * Lattice;
92
/*****************************************************************************/
93
/* Python BPy_Lattice methods declarations: */
94
/*****************************************************************************/
95
static PyObject *Lattice_getName(BPy_Lattice *self);
96
static PyObject *Lattice_setName(BPy_Lattice *self, PyObject *args);
97
static PyObject *Lattice_setPartitions(BPy_Lattice *self, PyObject *args);
98
static PyObject *Lattice_getPartitions(BPy_Lattice *self, PyObject *args);
99
static PyObject *Lattice_setKeyTypes(BPy_Lattice *self, PyObject *args);
100
static PyObject *Lattice_getKeyTypes(BPy_Lattice *self, PyObject *args);
101
static PyObject *Lattice_setMode(BPy_Lattice *self, PyObject *args);
102
static PyObject *Lattice_getMode(BPy_Lattice *self, PyObject *args);
103
static PyObject *Lattice_setPoint(BPy_Lattice *self, PyObject *args);
104
static PyObject *Lattice_getPoint(BPy_Lattice *self, PyObject *args);
105
static PyObject *Lattice_applyDeform(BPy_Lattice *self);
106
static PyObject *Lattice_insertKey(BPy_Lattice *self, PyObject *args);
108
/*****************************************************************************/
109
/* The following string definitions are used for documentation strings. */
110
/* In Python these will be written to the console when doing a */
111
/* Blender.Lattice.__doc__ Lattice Strings */
112
/*****************************************************************************/
113
static char Lattice_getName_doc[] =
114
"() - Return Lattice Object name";
116
static char Lattice_setName_doc[] =
117
"(str) - Change Lattice Object name";
119
static char Lattice_setPartitions_doc[] =
120
"(str) - Set the number of Partitions in x,y,z";
122
static char Lattice_getPartitions_doc[] =
123
"(str) - Get the number of Partitions in x,y,z";
125
static char Lattice_setKeyTypes_doc[] =
126
"(str) - Set the key types for x,y,z dimensions";
128
static char Lattice_getKeyTypes_doc[] =
129
"(str) - Get the key types for x,y,z dimensions";
131
static char Lattice_setMode_doc[] =
132
"(str) - Make an outside or grid lattice";
134
static char Lattice_getMode_doc[] =
135
"(str) - Get lattice mode type";
137
static char Lattice_setPoint_doc[] =
138
"(str) - Set the coordinates of a point on the lattice";
140
static char Lattice_getPoint_doc[] =
141
"(str) - Get the coordinates of a point on the lattice";
143
static char Lattice_applyDeform_doc[] =
144
"(str) - Apply the new lattice deformation to children";
146
static char Lattice_insertKey_doc[] =
147
"(str) - Set a new key for the lattice at specified frame";
149
/*****************************************************************************/
150
/* Python BPy_Lattice methods table: */
151
/*****************************************************************************/
152
static PyMethodDef BPy_Lattice_methods[] = {
153
/* name, method, flags, doc */
154
{"getName", (PyCFunction)Lattice_getName, METH_NOARGS,
155
Lattice_getName_doc},
156
{"setName", (PyCFunction)Lattice_setName, METH_VARARGS,
157
Lattice_setName_doc},
158
{"setPartitions", (PyCFunction)Lattice_setPartitions, METH_VARARGS,
159
Lattice_setPartitions_doc},
160
{"getPartitions", (PyCFunction)Lattice_getPartitions, METH_NOARGS,
161
Lattice_getPartitions_doc},
162
{"setKeyTypes", (PyCFunction)Lattice_setKeyTypes, METH_VARARGS,
163
Lattice_setKeyTypes_doc},
164
{"getKeyTypes", (PyCFunction)Lattice_getKeyTypes, METH_NOARGS,
165
Lattice_getKeyTypes_doc},
166
{"setMode", (PyCFunction)Lattice_setMode, METH_VARARGS,
167
Lattice_setMode_doc},
168
{"getMode", (PyCFunction)Lattice_getMode, METH_NOARGS,
169
Lattice_getMode_doc},
170
{"setPoint", (PyCFunction)Lattice_setPoint, METH_VARARGS,
171
Lattice_setPoint_doc},
172
{"getPoint", (PyCFunction)Lattice_getPoint, METH_VARARGS,
173
Lattice_getPoint_doc},
174
{"applyDeform", (PyCFunction)Lattice_applyDeform, METH_NOARGS,
175
Lattice_applyDeform_doc},
176
{"insertKey", (PyCFunction)Lattice_insertKey, METH_VARARGS,
177
Lattice_insertKey_doc},
181
/*****************************************************************************/
182
/* Python Lattice_Type callback function prototypes: */
183
/*****************************************************************************/
184
static void Lattice_dealloc (BPy_Lattice *self);
185
static int Lattice_setAttr (BPy_Lattice *self, char *name, PyObject *v);
186
static PyObject *Lattice_getAttr (BPy_Lattice *self, char *name);
187
static PyObject *Lattice_repr (BPy_Lattice *self);
189
/*****************************************************************************/
190
/* Python Lattice_Type structure definition: */
191
/*****************************************************************************/
192
PyTypeObject Lattice_Type =
194
PyObject_HEAD_INIT(NULL)
196
"Blender Lattice", /* tp_name */
197
sizeof (BPy_Lattice), /* tp_basicsize */
200
(destructor)Lattice_dealloc, /* tp_dealloc */
202
(getattrfunc)Lattice_getAttr, /* tp_getattr */
203
(setattrfunc)Lattice_setAttr, /* tp_setattr */
205
(reprfunc)Lattice_repr, /* tp_repr */
206
0, /* tp_as_number */
207
0, /* tp_as_sequence */
208
0, /* tp_as_mapping */
213
BPy_Lattice_methods, /* tp_methods */
217
static int Lattice_InLatList(BPy_Lattice *self);
218
static int Lattice_IsLinkedToObject(BPy_Lattice *self);
220
#endif /* EXPP_LATTICE_H */
54
PyObject *Lattice_Init( void );
55
PyObject *Lattice_CreatePyObject( Lattice * lt );
56
Lattice *Lattice_FromPyObject( PyObject * pyobj );
57
int Lattice_CheckPyObject( PyObject * pyobj );
60
#endif /* EXPP_LATTICE_H */