Blender  V2.93
bmesh_py_types_customdata.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2012 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 /* all use BPy_BMLayerAccess struct */
27 extern PyTypeObject BPy_BMLayerAccessVert_Type;
28 extern PyTypeObject BPy_BMLayerAccessEdge_Type;
29 extern PyTypeObject BPy_BMLayerAccessFace_Type;
30 extern PyTypeObject BPy_BMLayerAccessLoop_Type;
31 
32 extern PyTypeObject BPy_BMLayerCollection_Type;
33 extern PyTypeObject BPy_BMLayerItem_Type;
34 
35 #define BPy_BMLayerAccess_Check(v) (Py_TYPE(v) == &BPy_BMLayerAccess_Type)
36 #define BPy_BMLayerCollection_Check(v) (Py_TYPE(v) == &BPy_BMLayerCollection_Type)
37 #define BPy_BMLayerItem_Check(v) (Py_TYPE(v) == &BPy_BMLayerItem_Type)
38 
39 /* all layers for vert/edge/face/loop */
40 typedef struct BPy_BMLayerAccess {
41  PyObject_VAR_HEAD
42  struct BMesh *bm; /* keep first */
43  char htype;
45 
46 /* access different layer types deform/uv/vertexcolor */
47 typedef struct BPy_BMLayerCollection {
48  PyObject_VAR_HEAD
49  struct BMesh *bm; /* keep first */
50  char htype;
51  int type; /* customdata type - CD_XXX */
53 
54 /* access a specific layer directly */
55 typedef struct BPy_BMLayerItem {
56  PyObject_VAR_HEAD
57  struct BMesh *bm; /* keep first */
58  char htype;
59  int type; /* customdata type - CD_XXX */
60  int index; /* index of this layer type */
62 
63 PyObject *BPy_BMLayerAccess_CreatePyObject(BMesh *bm, const char htype);
64 PyObject *BPy_BMLayerCollection_CreatePyObject(BMesh *bm, const char htype, int type);
65 PyObject *BPy_BMLayerItem_CreatePyObject(BMesh *bm, const char htype, int type, int index);
66 
68 
69 /* __getitem__ / __setitem__ */
70 PyObject *BPy_BMLayerItem_GetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer);
71 int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObject *value);
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
ATTR_WARN_UNUSED_RESULT BMesh * bm
PyTypeObject BPy_BMLayerCollection_Type
PyObject * BPy_BMLayerCollection_CreatePyObject(BMesh *bm, const char htype, int type)
PyTypeObject BPy_BMLayerItem_Type
PyObject * BPy_BMLayerAccess_CreatePyObject(BMesh *bm, const char htype)
struct BPy_BMLayerItem BPy_BMLayerItem
PyTypeObject BPy_BMLayerAccessLoop_Type
void BPy_BM_init_types_customdata(void)
PyTypeObject BPy_BMLayerAccessVert_Type
PyTypeObject BPy_BMLayerAccessFace_Type
struct BPy_BMLayerCollection BPy_BMLayerCollection
struct BPy_BMLayerAccess BPy_BMLayerAccess
PyTypeObject BPy_BMLayerAccessEdge_Type
PyObject * BPy_BMLayerItem_CreatePyObject(BMesh *bm, const char htype, int type, int index)
int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObject *value)
PyObject * BPy_BMLayerItem_GetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer)
BMElem.__getitem__()
PyObject_VAR_HEAD struct BMesh * bm
PyObject_VAR_HEAD struct BMesh * bm
PyObject_VAR_HEAD struct BMesh * bm