~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/python/api2_2x/Lattice.h

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* 
 
2
 * $Id: Lattice.h,v 1.4 2004/10/07 19:25:39 stiv Exp $
2
3
 *
3
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
4
5
 *
33
34
#define EXPP_Lattice_H
34
35
 
35
36
#include <Python.h>
36
 
#include <BKE_main.h>
37
 
#include <BKE_global.h>
38
 
#include <BKE_library.h>
39
 
#include <BKE_lattice.h>
40
 
#include <BKE_utildefines.h>
41
 
#include <BKE_key.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>
47
 
#include "blendef.h"
48
 
#include "mydevice.h"
49
 
#include "constant.h"
50
 
#include "gen_utils.h"
51
 
#include "modules.h"
52
 
 
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);
58
 
 
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";
66
 
 
67
 
static char M_Lattice_New_doc[] =
68
 
"() - return a new Lattice object";
69
 
 
70
 
static char M_Lattice_Get_doc[] =
71
 
"() - geta a Lattice from blender";
72
 
 
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,
78
 
                                        M_Lattice_New_doc},
79
 
        {"Get",(PyCFunction)M_Lattice_Get, METH_VARARGS,
80
 
                                        M_Lattice_Get_doc},
81
 
        {NULL, NULL, 0, NULL}
82
 
};
83
 
 
84
 
/*****************************************************************************/
85
 
/* Python BPy_Lattice structure definition:                                                                                                                                                     */
 
38
 
 
39
 
 
40
 
 
41
/*****************************************************************************/
 
42
/* Python BPy_Lattice structure definition:   */
86
43
/*****************************************************************************/
87
44
typedef struct {
88
 
        PyObject_HEAD
89
 
        Lattice *Lattice;
 
45
        PyObject_HEAD Lattice * Lattice;
90
46
} BPy_Lattice;
91
47
 
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);
107
 
 
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";
115
 
 
116
 
static char Lattice_setName_doc[] =
117
 
"(str) - Change Lattice Object name";
118
 
 
119
 
static char Lattice_setPartitions_doc[] =
120
 
"(str) - Set the number of Partitions in x,y,z";
121
 
 
122
 
static char Lattice_getPartitions_doc[] =
123
 
"(str) - Get the number of Partitions in x,y,z";
124
 
 
125
 
static char Lattice_setKeyTypes_doc[] =
126
 
"(str) - Set the key types for x,y,z dimensions";
127
 
 
128
 
static char Lattice_getKeyTypes_doc[] =
129
 
"(str) - Get the key types for x,y,z dimensions";
130
 
 
131
 
static char Lattice_setMode_doc[] =
132
 
"(str) - Make an outside or grid lattice";
133
 
 
134
 
static char Lattice_getMode_doc[] =
135
 
"(str) - Get lattice mode type";
136
 
 
137
 
static char Lattice_setPoint_doc[] =
138
 
"(str) - Set the coordinates of a point on the lattice";
139
 
 
140
 
static char Lattice_getPoint_doc[] =
141
 
"(str) - Get the coordinates of a point on the lattice";
142
 
 
143
 
static char Lattice_applyDeform_doc[] =
144
 
"(str) - Apply the new lattice deformation to children";
145
 
 
146
 
static char Lattice_insertKey_doc[] =
147
 
"(str) - Set a new key for the lattice at specified frame";
148
 
 
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},
178
 
        {0}
179
 
};
180
 
 
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);
188
 
 
189
 
/*****************************************************************************/
190
 
/* Python Lattice_Type structure definition:                                                                                                                                            */
191
 
/*****************************************************************************/
192
 
PyTypeObject Lattice_Type =
193
 
{
194
 
        PyObject_HEAD_INIT(NULL)
195
 
        0,                                                                                                                                              /* ob_size */
196
 
        "Blender Lattice",                                                                              /* tp_name */
197
 
        sizeof (BPy_Lattice),                                                                   /* tp_basicsize */
198
 
        0,                                                                                                                                              /* tp_itemsize */
199
 
        /* methods */
200
 
        (destructor)Lattice_dealloc,                                    /* tp_dealloc */
201
 
        0,                                                                                                                                              /* tp_print */
202
 
        (getattrfunc)Lattice_getAttr,                                   /* tp_getattr */
203
 
        (setattrfunc)Lattice_setAttr,                                   /* tp_setattr */
204
 
        0,                                                                                              /* tp_compare */
205
 
        (reprfunc)Lattice_repr,                                                         /* tp_repr */
206
 
        0,                                                                                                                                              /* tp_as_number */
207
 
        0,                                                                                                                                              /* tp_as_sequence */
208
 
        0,                                                                                                                                              /* tp_as_mapping */
209
 
        0,                                                                                                                                              /* tp_as_hash */
210
 
        0,0,0,0,0,0,
211
 
        0,                                                                                                                                              /* tp_doc */ 
212
 
        0,0,0,0,0,0,
213
 
        BPy_Lattice_methods,                                                                    /* tp_methods */
214
 
        0,                                                                                                                                              /* tp_members */
215
 
};
216
 
 
217
 
static int Lattice_InLatList(BPy_Lattice *self);
218
 
static int Lattice_IsLinkedToObject(BPy_Lattice *self);
219
 
 
220
 
#endif /* EXPP_LATTICE_H */
 
48
 
 
49
 
 
50
/*
 
51
 * prototypes
 
52
 */
 
53
 
 
54
PyObject *Lattice_Init( void );
 
55
PyObject *Lattice_CreatePyObject( Lattice * lt );
 
56
Lattice *Lattice_FromPyObject( PyObject * pyobj );
 
57
int Lattice_CheckPyObject( PyObject * pyobj );
 
58
 
 
59
 
 
60
#endif                          /* EXPP_LATTICE_H */