From 6c0c53161e366ea4d208b69eb255754291f7e39d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 24 Sep 2024 16:27:18 +0200 Subject: [PATCH] Refactor: Move BPY `bmesh` headers to proper C++ ones. --- source/blender/python/bmesh/CMakeLists.txt | 18 ++-- source/blender/python/bmesh/bmesh_py_api.cc | 16 ++-- .../bmesh/{bmesh_py_api.h => bmesh_py_api.hh} | 10 +-- .../blender/python/bmesh/bmesh_py_geometry.cc | 4 +- .../{bmesh_py_ops.h => bmesh_py_geometry.hh} | 10 +-- source/blender/python/bmesh/bmesh_py_ops.cc | 4 +- .../{bmesh_py_utils.h => bmesh_py_ops.hh} | 10 +-- .../blender/python/bmesh/bmesh_py_ops_call.cc | 4 +- ...esh_py_ops_call.h => bmesh_py_ops_call.hh} | 12 +-- source/blender/python/bmesh/bmesh_py_types.cc | 8 +- .../{bmesh_py_types.h => bmesh_py_types.hh} | 89 +++++++++---------- .../python/bmesh/bmesh_py_types_customdata.cc | 6 +- ...tomdata.h => bmesh_py_types_customdata.hh} | 28 +++--- .../python/bmesh/bmesh_py_types_meshdata.cc | 2 +- ..._meshdata.h => bmesh_py_types_meshdata.hh} | 14 +-- .../python/bmesh/bmesh_py_types_select.cc | 4 +- ...ypes_select.h => bmesh_py_types_select.hh} | 28 +++--- source/blender/python/bmesh/bmesh_py_utils.cc | 4 +- ...{bmesh_py_geometry.h => bmesh_py_utils.hh} | 10 +-- source/blender/python/intern/bpy_interface.cc | 2 +- .../python/mathutils/mathutils_bvhtree.cc | 2 +- 21 files changed, 108 insertions(+), 177 deletions(-) rename source/blender/python/bmesh/{bmesh_py_api.h => bmesh_py_api.hh} (59%) rename source/blender/python/bmesh/{bmesh_py_ops.h => bmesh_py_geometry.hh} (58%) rename source/blender/python/bmesh/{bmesh_py_utils.h => bmesh_py_ops.hh} (58%) rename source/blender/python/bmesh/{bmesh_py_ops_call.h => bmesh_py_ops_call.hh} (76%) rename source/blender/python/bmesh/{bmesh_py_types.h => bmesh_py_types.hh} (84%) rename source/blender/python/bmesh/{bmesh_py_types_customdata.h => bmesh_py_types_customdata.hh} (80%) rename source/blender/python/bmesh/{bmesh_py_types_meshdata.h => bmesh_py_types_meshdata.hh} (85%) rename source/blender/python/bmesh/{bmesh_py_types_select.h => bmesh_py_types_select.hh} (61%) rename source/blender/python/bmesh/{bmesh_py_geometry.h => bmesh_py_utils.hh} (57%) diff --git a/source/blender/python/bmesh/CMakeLists.txt b/source/blender/python/bmesh/CMakeLists.txt index 8fac7ab56e0..6109aa5778b 100644 --- a/source/blender/python/bmesh/CMakeLists.txt +++ b/source/blender/python/bmesh/CMakeLists.txt @@ -23,15 +23,15 @@ set(SRC bmesh_py_types_select.cc bmesh_py_utils.cc - bmesh_py_api.h - bmesh_py_geometry.h - bmesh_py_ops.h - bmesh_py_ops_call.h - bmesh_py_types.h - bmesh_py_types_customdata.h - bmesh_py_types_meshdata.h - bmesh_py_types_select.h - bmesh_py_utils.h + bmesh_py_api.hh + bmesh_py_geometry.hh + bmesh_py_ops.hh + bmesh_py_ops_call.hh + bmesh_py_types.hh + bmesh_py_types_customdata.hh + bmesh_py_types_meshdata.hh + bmesh_py_types_select.hh + bmesh_py_utils.hh ) set(LIB diff --git a/source/blender/python/bmesh/bmesh_py_api.cc b/source/blender/python/bmesh/bmesh_py_api.cc index 62c64f6bc7f..36ea413e110 100644 --- a/source/blender/python/bmesh/bmesh_py_api.cc +++ b/source/blender/python/bmesh/bmesh_py_api.cc @@ -14,14 +14,14 @@ #include "bmesh.hh" -#include "bmesh_py_types.h" -#include "bmesh_py_types_customdata.h" -#include "bmesh_py_types_meshdata.h" -#include "bmesh_py_types_select.h" +#include "bmesh_py_types.hh" +#include "bmesh_py_types_customdata.hh" +#include "bmesh_py_types_meshdata.hh" +#include "bmesh_py_types_select.hh" -#include "bmesh_py_geometry.h" -#include "bmesh_py_ops.h" -#include "bmesh_py_utils.h" +#include "bmesh_py_geometry.hh" +#include "bmesh_py_ops.hh" +#include "bmesh_py_utils.hh" #include "BKE_editmesh.hh" #include "BKE_mesh_types.hh" @@ -30,7 +30,7 @@ #include "../generic/py_capi_utils.hh" -#include "bmesh_py_api.h" /* own include */ +#include "bmesh_py_api.hh" /* own include */ PyDoc_STRVAR( /* Wrap. */ diff --git a/source/blender/python/bmesh/bmesh_py_api.h b/source/blender/python/bmesh/bmesh_py_api.hh similarity index 59% rename from source/blender/python/bmesh/bmesh_py_api.h rename to source/blender/python/bmesh/bmesh_py_api.hh index 39389a7361e..990cfd93d54 100644 --- a/source/blender/python/bmesh/bmesh_py_api.h +++ b/source/blender/python/bmesh/bmesh_py_api.hh @@ -8,12 +8,4 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - -PyObject *BPyInit_bmesh(void); - -#ifdef __cplusplus -} -#endif +PyObject *BPyInit_bmesh(); diff --git a/source/blender/python/bmesh/bmesh_py_geometry.cc b/source/blender/python/bmesh/bmesh_py_geometry.cc index 1d978591f12..640858673d7 100644 --- a/source/blender/python/bmesh/bmesh_py_geometry.cc +++ b/source/blender/python/bmesh/bmesh_py_geometry.cc @@ -16,8 +16,8 @@ #include "../mathutils/mathutils.hh" #include "bmesh.hh" -#include "bmesh_py_geometry.h" /* own include */ -#include "bmesh_py_types.h" +#include "bmesh_py_geometry.hh" /* own include */ +#include "bmesh_py_types.hh" PyDoc_STRVAR( /* Wrap. */ diff --git a/source/blender/python/bmesh/bmesh_py_ops.h b/source/blender/python/bmesh/bmesh_py_geometry.hh similarity index 58% rename from source/blender/python/bmesh/bmesh_py_ops.h rename to source/blender/python/bmesh/bmesh_py_geometry.hh index 3f144b63434..2e3b58969b3 100644 --- a/source/blender/python/bmesh/bmesh_py_ops.h +++ b/source/blender/python/bmesh/bmesh_py_geometry.hh @@ -8,12 +8,4 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - -PyObject *BPyInit_bmesh_ops(void); - -#ifdef __cplusplus -} -#endif +PyObject *BPyInit_bmesh_geometry(); diff --git a/source/blender/python/bmesh/bmesh_py_ops.cc b/source/blender/python/bmesh/bmesh_py_ops.cc index c0653d7bf0f..6864a456aa9 100644 --- a/source/blender/python/bmesh/bmesh_py_ops.cc +++ b/source/blender/python/bmesh/bmesh_py_ops.cc @@ -18,8 +18,8 @@ #include "bmesh.hh" -#include "bmesh_py_ops.h" /* own include */ -#include "bmesh_py_ops_call.h" +#include "bmesh_py_ops.hh" /* own include */ +#include "bmesh_py_ops_call.hh" /* bmesh operator 'bmesh.ops.*' callable types * ******************************************* */ diff --git a/source/blender/python/bmesh/bmesh_py_utils.h b/source/blender/python/bmesh/bmesh_py_ops.hh similarity index 58% rename from source/blender/python/bmesh/bmesh_py_utils.h rename to source/blender/python/bmesh/bmesh_py_ops.hh index d54a1b8c974..699db2c4b70 100644 --- a/source/blender/python/bmesh/bmesh_py_utils.h +++ b/source/blender/python/bmesh/bmesh_py_ops.hh @@ -8,12 +8,4 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - -PyObject *BPyInit_bmesh_utils(void); - -#ifdef __cplusplus -} -#endif +PyObject *BPyInit_bmesh_ops(); diff --git a/source/blender/python/bmesh/bmesh_py_ops_call.cc b/source/blender/python/bmesh/bmesh_py_ops_call.cc index 1014ee861e3..cc11c980413 100644 --- a/source/blender/python/bmesh/bmesh_py_ops_call.cc +++ b/source/blender/python/bmesh/bmesh_py_ops_call.cc @@ -18,9 +18,9 @@ #include "bmesh.hh" -#include "bmesh_py_ops_call.h" /* own include */ +#include "bmesh_py_ops_call.hh" /* own include */ -#include "bmesh_py_types.h" +#include "bmesh_py_types.hh" #include "../generic/py_capi_utils.hh" #include "../generic/python_utildefines.hh" diff --git a/source/blender/python/bmesh/bmesh_py_ops_call.h b/source/blender/python/bmesh/bmesh_py_ops_call.hh similarity index 76% rename from source/blender/python/bmesh/bmesh_py_ops_call.h rename to source/blender/python/bmesh/bmesh_py_ops_call.hh index 953f16eaf5f..64a72f7099e 100644 --- a/source/blender/python/bmesh/bmesh_py_ops_call.h +++ b/source/blender/python/bmesh/bmesh_py_ops_call.hh @@ -8,20 +8,12 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { +struct BPy_BMeshOpFunc { PyObject_HEAD /* Required Python macro. */ const char *opname; -} BPy_BMeshOpFunc; +}; /** * This is the `__call__` for `bmesh.ops.xxx()`. */ PyObject *BPy_BMO_call(BPy_BMeshOpFunc *self, PyObject *args, PyObject *kw); - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/python/bmesh/bmesh_py_types.cc b/source/blender/python/bmesh/bmesh_py_types.cc index 79cd55eb31d..e81dfcce8fa 100644 --- a/source/blender/python/bmesh/bmesh_py_types.cc +++ b/source/blender/python/bmesh/bmesh_py_types.cc @@ -36,10 +36,10 @@ #include "../generic/py_capi_utils.hh" #include "../generic/python_utildefines.hh" -#include "bmesh_py_types.h" /* own include */ -#include "bmesh_py_types_customdata.h" -#include "bmesh_py_types_meshdata.h" -#include "bmesh_py_types_select.h" +#include "bmesh_py_types.hh" /* own include */ +#include "bmesh_py_types_customdata.hh" +#include "bmesh_py_types_meshdata.hh" +#include "bmesh_py_types_select.hh" static void bm_dealloc_editmode_warn(BPy_BMesh *self); diff --git a/source/blender/python/bmesh/bmesh_py_types.h b/source/blender/python/bmesh/bmesh_py_types.hh similarity index 84% rename from source/blender/python/bmesh/bmesh_py_types.h rename to source/blender/python/bmesh/bmesh_py_types.hh index a325acdf934..850c024c4cb 100644 --- a/source/blender/python/bmesh/bmesh_py_types.h +++ b/source/blender/python/bmesh/bmesh_py_types.hh @@ -8,9 +8,12 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif +struct BMesh; +struct BMEdge; +struct BMElem; +struct BMFace; +struct BMLoop; +struct BMVert; extern PyTypeObject BPy_BMesh_Type; extern PyTypeObject BPy_BMVert_Type; @@ -41,48 +44,48 @@ extern PyTypeObject BPy_BMIter_Type; #define BPy_BMElem_Check(v) (Py_TYPE(v)->tp_hash == BPy_BMVert_Type.tp_hash) /* cast from _any_ bmesh type - they all have BMesh first */ -typedef struct BPy_BMGeneric { +struct BPy_BMGeneric { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ -} BPy_BMGeneric; + BMesh *bm; /* keep first */ +}; /* BPy_BMVert/BPy_BMEdge/BPy_BMFace/BPy_BMLoop can cast to this */ -typedef struct BPy_BMElem { +struct BPy_BMElem { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ - struct BMElem *ele; -} BPy_BMElem; + BMesh *bm; /* keep first */ + BMElem *ele; +}; -typedef struct BPy_BMesh { +struct BPy_BMesh { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ + BMesh *bm; /* keep first */ int flag; -} BPy_BMesh; +}; /* element types */ -typedef struct BPy_BMVert { +struct BPy_BMVert { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ - struct BMVert *v; -} BPy_BMVert; + BMesh *bm; /* keep first */ + BMVert *v; +}; -typedef struct BPy_BMEdge { +struct BPy_BMEdge { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ - struct BMEdge *e; -} BPy_BMEdge; + BMesh *bm; /* keep first */ + BMEdge *e; +}; -typedef struct BPy_BMFace { +struct BPy_BMFace { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ - struct BMFace *f; -} BPy_BMFace; + BMesh *bm; /* keep first */ + BMFace *f; +}; -typedef struct BPy_BMLoop { +struct BPy_BMLoop { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ - struct BMLoop *l; -} BPy_BMLoop; + BMesh *bm; /* keep first */ + BMLoop *l; +}; /* iterators */ @@ -93,9 +96,9 @@ typedef struct BPy_BMLoop { * - BPy_BMFaceSeq_Type * - BPy_BMLoopSeq_Type */ -typedef struct BPy_BMElemSeq { +struct BPy_BMElemSeq { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ + BMesh *bm; /* keep first */ /* if this is a sequence on an existing element, * loops of faces for eg. @@ -108,17 +111,17 @@ typedef struct BPy_BMElemSeq { /* iterator type */ short itype; -} BPy_BMElemSeq; +}; -typedef struct BPy_BMIter { +struct BPy_BMIter { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ + BMesh *bm; /* keep first */ BMIter iter; -} BPy_BMIter; +}; -void BPy_BM_init_types(void); +void BPy_BM_init_types(); -PyObject *BPyInit_bmesh_types(void); +PyObject *BPyInit_bmesh_types(); enum { BPY_BMFLAG_NOP = 0, /* do nothing */ @@ -230,15 +233,3 @@ int bpy_bm_generic_valid_check_source(BMesh *bm_source, (bpy_bmelemseq)->py_ele ? ((BPy_BMElem *)(bpy_bmelemseq)->py_ele)->ele : NULL); \ ele; \ BM_CHECK_TYPE_ELEM_ASSIGN(ele) = BM_iter_step(iter)) - -#ifdef __PY_CAPI_UTILS_H__ -struct PyC_FlagSet; -extern struct PyC_FlagSet bpy_bm_scene_vert_edge_face_flags[]; -extern struct PyC_FlagSet bpy_bm_htype_vert_edge_face_flags[]; -extern struct PyC_FlagSet bpy_bm_htype_all_flags[]; -extern struct PyC_FlagSet bpy_bm_hflag_all_flags[]; -#endif - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.cc b/source/blender/python/bmesh/bmesh_py_types_customdata.cc index c8c0aa02e1c..051cf5df543 100644 --- a/source/blender/python/bmesh/bmesh_py_types_customdata.cc +++ b/source/blender/python/bmesh/bmesh_py_types_customdata.cc @@ -16,9 +16,9 @@ #include "bmesh.hh" -#include "bmesh_py_types.h" -#include "bmesh_py_types_customdata.h" -#include "bmesh_py_types_meshdata.h" +#include "bmesh_py_types.hh" +#include "bmesh_py_types_customdata.hh" +#include "bmesh_py_types_meshdata.hh" #include "../generic/py_capi_utils.hh" #include "../generic/python_utildefines.hh" diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.h b/source/blender/python/bmesh/bmesh_py_types_customdata.hh similarity index 80% rename from source/blender/python/bmesh/bmesh_py_types_customdata.h rename to source/blender/python/bmesh/bmesh_py_types_customdata.hh index 3d88a286aa3..5e204b48274 100644 --- a/source/blender/python/bmesh/bmesh_py_types_customdata.h +++ b/source/blender/python/bmesh/bmesh_py_types_customdata.hh @@ -8,9 +8,7 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif +struct BMesh; /* All use #BPy_BMLayerAccess struct. */ @@ -27,34 +25,34 @@ extern PyTypeObject BPy_BMLayerItem_Type; #define BPy_BMLayerItem_Check(v) (Py_TYPE(v) == &BPy_BMLayerItem_Type) /** All layers for vert/edge/face/loop. */ -typedef struct BPy_BMLayerAccess { +struct BPy_BMLayerAccess { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ + BMesh *bm; /* keep first */ char htype; -} BPy_BMLayerAccess; +}; /** Access different layer types deform/uv/vertex-color. */ -typedef struct BPy_BMLayerCollection { +struct BPy_BMLayerCollection { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ + BMesh *bm; /* keep first */ char htype; int type; /* customdata type - CD_XXX */ -} BPy_BMLayerCollection; +}; /** Access a specific layer directly. */ -typedef struct BPy_BMLayerItem { +struct BPy_BMLayerItem { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ + BMesh *bm; /* keep first */ char htype; int type; /* customdata type - CD_XXX */ int index; /* index of this layer type */ -} BPy_BMLayerItem; +}; PyObject *BPy_BMLayerAccess_CreatePyObject(BMesh *bm, char htype); PyObject *BPy_BMLayerCollection_CreatePyObject(BMesh *bm, char htype, int type); PyObject *BPy_BMLayerItem_CreatePyObject(BMesh *bm, char htype, int type, int index); -void BPy_BM_init_types_customdata(void); +void BPy_BM_init_types_customdata(); /** *\brief BMElem.__getitem__() / __setitem__() @@ -63,7 +61,3 @@ void BPy_BM_init_types_customdata(void); */ PyObject *BPy_BMLayerItem_GetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer); int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObject *value); - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.cc b/source/blender/python/bmesh/bmesh_py_types_meshdata.cc index 218ad010936..02cadf4af43 100644 --- a/source/blender/python/bmesh/bmesh_py_types_meshdata.cc +++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.cc @@ -33,7 +33,7 @@ #include "BKE_deform.hh" #include "bmesh.hh" -#include "bmesh_py_types_meshdata.h" +#include "bmesh_py_types_meshdata.hh" #include "../generic/py_capi_utils.hh" #include "../generic/python_utildefines.hh" diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.h b/source/blender/python/bmesh/bmesh_py_types_meshdata.hh similarity index 85% rename from source/blender/python/bmesh/bmesh_py_types_meshdata.h rename to source/blender/python/bmesh/bmesh_py_types_meshdata.hh index 3ae07699fa2..ffc7039a1f4 100644 --- a/source/blender/python/bmesh/bmesh_py_types_meshdata.h +++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.hh @@ -8,19 +8,15 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - extern PyTypeObject BPy_BMLoopUV_Type; extern PyTypeObject BPy_BMDeformVert_Type; #define BPy_BMLoopUV_Check(v) (Py_TYPE(v) == &BPy_BMLoopUV_Type) -typedef struct BPy_BMGenericMeshData { +struct BPy_BMGenericMeshData { PyObject_VAR_HEAD void *data; -} BPy_BMGenericMeshData; +}; struct MDeformVert; struct MLoopCol; @@ -40,8 +36,4 @@ int BPy_BMDeformVert_AssignPyObject(struct MDeformVert *dvert, PyObject *value); PyObject *BPy_BMDeformVert_CreatePyObject(struct MDeformVert *dvert); /* call to init all types */ -void BPy_BM_init_types_meshdata(void); - -#ifdef __cplusplus -} -#endif +void BPy_BM_init_types_meshdata(); diff --git a/source/blender/python/bmesh/bmesh_py_types_select.cc b/source/blender/python/bmesh/bmesh_py_types_select.cc index b07aeff5fc2..3823b1723d2 100644 --- a/source/blender/python/bmesh/bmesh_py_types_select.cc +++ b/source/blender/python/bmesh/bmesh_py_types_select.cc @@ -19,8 +19,8 @@ #include "bmesh.hh" -#include "bmesh_py_types.h" -#include "bmesh_py_types_select.h" +#include "bmesh_py_types.hh" +#include "bmesh_py_types_select.hh" #include "../generic/python_utildefines.hh" diff --git a/source/blender/python/bmesh/bmesh_py_types_select.h b/source/blender/python/bmesh/bmesh_py_types_select.hh similarity index 61% rename from source/blender/python/bmesh/bmesh_py_types_select.h rename to source/blender/python/bmesh/bmesh_py_types_select.hh index f1224794f50..52076d76105 100644 --- a/source/blender/python/bmesh/bmesh_py_types_select.h +++ b/source/blender/python/bmesh/bmesh_py_types_select.hh @@ -8,10 +8,8 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - +struct BBMesh; +struct BMEditSelection; struct BPy_BMesh; extern PyTypeObject BPy_BMEditSelSeq_Type; @@ -20,26 +18,22 @@ extern PyTypeObject BPy_BMEditSelIter_Type; #define BPy_BMSelectHistory_Check(v) (Py_TYPE(v) == &BPy_BMEditSelSeq_Type) #define BPy_BMSelectHistoryIter_Check(v) (Py_TYPE(v) == &BPy_BMEditSelIter_Type) -typedef struct BPy_BMEditSelSeq { +struct BPy_BMEditSelSeq { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ -} BPy_BMEditSelSeq; + BMesh *bm; /* keep first */ +}; -typedef struct BPy_BMEditSelIter { +struct BPy_BMEditSelIter { PyObject_VAR_HEAD - struct BMesh *bm; /* keep first */ - struct BMEditSelection *ese; -} BPy_BMEditSelIter; + BMesh *bm; /* keep first */ + BMEditSelection *ese; +}; -void BPy_BM_init_types_select(void); +void BPy_BM_init_types_select(); PyObject *BPy_BMEditSel_CreatePyObject(BMesh *bm); PyObject *BPy_BMEditSelIter_CreatePyObject(BMesh *bm); /** * \note doesn't actually check selection. */ -int BPy_BMEditSel_Assign(struct BPy_BMesh *self, PyObject *value); - -#ifdef __cplusplus -} -#endif +int BPy_BMEditSel_Assign(BPy_BMesh *self, PyObject *value); diff --git a/source/blender/python/bmesh/bmesh_py_utils.cc b/source/blender/python/bmesh/bmesh_py_utils.cc index 22e3b4e9c4a..b81b3660896 100644 --- a/source/blender/python/bmesh/bmesh_py_utils.cc +++ b/source/blender/python/bmesh/bmesh_py_utils.cc @@ -19,8 +19,8 @@ #include "../mathutils/mathutils.hh" #include "bmesh.hh" -#include "bmesh_py_types.h" -#include "bmesh_py_utils.h" /* own include */ +#include "bmesh_py_types.hh" +#include "bmesh_py_utils.hh" /* own include */ #include "../generic/py_capi_utils.hh" #include "../generic/python_utildefines.hh" diff --git a/source/blender/python/bmesh/bmesh_py_geometry.h b/source/blender/python/bmesh/bmesh_py_utils.hh similarity index 57% rename from source/blender/python/bmesh/bmesh_py_geometry.h rename to source/blender/python/bmesh/bmesh_py_utils.hh index 7e5790afdd4..8aa8b206164 100644 --- a/source/blender/python/bmesh/bmesh_py_geometry.h +++ b/source/blender/python/bmesh/bmesh_py_utils.hh @@ -8,12 +8,4 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - -PyObject *BPyInit_bmesh_geometry(void); - -#ifdef __cplusplus -} -#endif +PyObject *BPyInit_bmesh_utils(); diff --git a/source/blender/python/intern/bpy_interface.cc b/source/blender/python/intern/bpy_interface.cc index ce96651e9aa..9b5ff12958b 100644 --- a/source/blender/python/intern/bpy_interface.cc +++ b/source/blender/python/intern/bpy_interface.cc @@ -62,7 +62,7 @@ #include "../generic/py_capi_utils.hh" /* `inittab` initialization functions. */ -#include "../bmesh/bmesh_py_api.h" +#include "../bmesh/bmesh_py_api.hh" #include "../generic/bgl.h" #include "../generic/bl_math_py_api.hh" #include "../generic/blf_py_api.hh" diff --git a/source/blender/python/mathutils/mathutils_bvhtree.cc b/source/blender/python/mathutils/mathutils_bvhtree.cc index 33f30d0280a..54806ee5707 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.cc +++ b/source/blender/python/mathutils/mathutils_bvhtree.cc @@ -44,7 +44,7 @@ # include "bmesh.hh" -# include "../bmesh/bmesh_py_types.h" +# include "../bmesh/bmesh_py_types.hh" #endif /* MATH_STANDALONE */ #include "BLI_strict_flags.h" /* Keep last. */