diff options
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 48 | ||||
-rw-r--r-- | source/blender/python/generic/idprop_py_api.c | 12 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_types.c | 18 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils.c | 10 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_bvhtree.c | 2 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_kdtree.c | 2 |
6 files changed, 37 insertions, 55 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index e9499818f64..5fca6f4cec6 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -3754,37 +3754,31 @@ PyObject *BPyInit_bmesh_types(void) submodule = PyModule_Create(&BPy_BM_types_module_def); -#define MODULE_TYPE_ADD(s, t) \ - PyModule_AddObject(s, t.tp_name, (PyObject *)&t); \ - Py_INCREF((PyObject *)&t) - /* bmesh_py_types.c */ - MODULE_TYPE_ADD(submodule, BPy_BMesh_Type); - MODULE_TYPE_ADD(submodule, BPy_BMVert_Type); - MODULE_TYPE_ADD(submodule, BPy_BMEdge_Type); - MODULE_TYPE_ADD(submodule, BPy_BMFace_Type); - MODULE_TYPE_ADD(submodule, BPy_BMLoop_Type); - MODULE_TYPE_ADD(submodule, BPy_BMElemSeq_Type); - MODULE_TYPE_ADD(submodule, BPy_BMVertSeq_Type); - MODULE_TYPE_ADD(submodule, BPy_BMEdgeSeq_Type); - MODULE_TYPE_ADD(submodule, BPy_BMFaceSeq_Type); - MODULE_TYPE_ADD(submodule, BPy_BMLoopSeq_Type); - MODULE_TYPE_ADD(submodule, BPy_BMIter_Type); + PyModule_AddType(submodule, &BPy_BMesh_Type); + PyModule_AddType(submodule, &BPy_BMVert_Type); + PyModule_AddType(submodule, &BPy_BMEdge_Type); + PyModule_AddType(submodule, &BPy_BMFace_Type); + PyModule_AddType(submodule, &BPy_BMLoop_Type); + PyModule_AddType(submodule, &BPy_BMElemSeq_Type); + PyModule_AddType(submodule, &BPy_BMVertSeq_Type); + PyModule_AddType(submodule, &BPy_BMEdgeSeq_Type); + PyModule_AddType(submodule, &BPy_BMFaceSeq_Type); + PyModule_AddType(submodule, &BPy_BMLoopSeq_Type); + PyModule_AddType(submodule, &BPy_BMIter_Type); /* bmesh_py_types_select.c */ - MODULE_TYPE_ADD(submodule, BPy_BMEditSelSeq_Type); - MODULE_TYPE_ADD(submodule, BPy_BMEditSelIter_Type); + PyModule_AddType(submodule, &BPy_BMEditSelSeq_Type); + PyModule_AddType(submodule, &BPy_BMEditSelIter_Type); /* bmesh_py_types_customdata.c */ - MODULE_TYPE_ADD(submodule, BPy_BMLayerAccessVert_Type); - MODULE_TYPE_ADD(submodule, BPy_BMLayerAccessEdge_Type); - MODULE_TYPE_ADD(submodule, BPy_BMLayerAccessFace_Type); - MODULE_TYPE_ADD(submodule, BPy_BMLayerAccessLoop_Type); - MODULE_TYPE_ADD(submodule, BPy_BMLayerCollection_Type); - MODULE_TYPE_ADD(submodule, BPy_BMLayerItem_Type); + PyModule_AddType(submodule, &BPy_BMLayerAccessVert_Type); + PyModule_AddType(submodule, &BPy_BMLayerAccessEdge_Type); + PyModule_AddType(submodule, &BPy_BMLayerAccessFace_Type); + PyModule_AddType(submodule, &BPy_BMLayerAccessLoop_Type); + PyModule_AddType(submodule, &BPy_BMLayerCollection_Type); + PyModule_AddType(submodule, &BPy_BMLayerItem_Type); /* bmesh_py_types_meshdata.c */ - MODULE_TYPE_ADD(submodule, BPy_BMLoopUV_Type); - MODULE_TYPE_ADD(submodule, BPy_BMDeformVert_Type); - -#undef MODULE_TYPE_ADD + PyModule_AddType(submodule, &BPy_BMLoopUV_Type); + PyModule_AddType(submodule, &BPy_BMDeformVert_Type); return submodule; } diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index daa604a3fbf..6be7348a2f8 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -1799,16 +1799,10 @@ static PyObject *BPyInit_idprop_types(void) IDProp_Init_Types(); -#define MODULE_TYPE_ADD(s, t) \ - PyModule_AddObject(s, t.tp_name, (PyObject *)&t); \ - Py_INCREF((PyObject *)&t) - /* bmesh_py_types.c */ - MODULE_TYPE_ADD(submodule, BPy_IDGroup_Type); - MODULE_TYPE_ADD(submodule, BPy_IDGroup_Iter_Type); - MODULE_TYPE_ADD(submodule, BPy_IDArray_Type); - -#undef MODULE_TYPE_ADD + PyModule_AddType(submodule, &BPy_IDGroup_Type); + PyModule_AddType(submodule, &BPy_IDGroup_Iter_Type); + PyModule_AddType(submodule, &BPy_IDArray_Type); return submodule; } diff --git a/source/blender/python/gpu/gpu_py_types.c b/source/blender/python/gpu/gpu_py_types.c index d70c5ba4966..f0208d3993e 100644 --- a/source/blender/python/gpu/gpu_py_types.c +++ b/source/blender/python/gpu/gpu_py_types.c @@ -62,18 +62,12 @@ PyObject *bpygpu_types_init(void) return NULL; } -#define MODULE_TYPE_ADD(s, t) \ - PyModule_AddObject(s, t.tp_name, (PyObject *)&t); \ - Py_INCREF((PyObject *)&t) - - MODULE_TYPE_ADD(submodule, BPyGPUVertFormat_Type); - MODULE_TYPE_ADD(submodule, BPyGPUVertBuf_Type); - MODULE_TYPE_ADD(submodule, BPyGPUIndexBuf_Type); - MODULE_TYPE_ADD(submodule, BPyGPUBatch_Type); - MODULE_TYPE_ADD(submodule, BPyGPUOffScreen_Type); - MODULE_TYPE_ADD(submodule, BPyGPUShader_Type); - -#undef MODULE_TYPE_ADD + PyModule_AddType(submodule, &BPyGPUVertFormat_Type); + PyModule_AddType(submodule, &BPyGPUVertBuf_Type); + PyModule_AddType(submodule, &BPyGPUIndexBuf_Type); + PyModule_AddType(submodule, &BPyGPUBatch_Type); + PyModule_AddType(submodule, &BPyGPUOffScreen_Type); + PyModule_AddType(submodule, &BPyGPUShader_Type); return submodule; } diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c index 1616bbeeea9..3791a6c2d29 100644 --- a/source/blender/python/mathutils/mathutils.c +++ b/source/blender/python/mathutils/mathutils.c @@ -784,11 +784,11 @@ PyMODINIT_FUNC PyInit_mathutils(void) mod = PyModule_Create(&M_Mathutils_module_def); /* each type has its own new() function */ - PyModule_AddObject(mod, vector_Type.tp_name, (PyObject *)&vector_Type); - PyModule_AddObject(mod, matrix_Type.tp_name, (PyObject *)&matrix_Type); - PyModule_AddObject(mod, euler_Type.tp_name, (PyObject *)&euler_Type); - PyModule_AddObject(mod, quaternion_Type.tp_name, (PyObject *)&quaternion_Type); - PyModule_AddObject(mod, color_Type.tp_name, (PyObject *)&color_Type); + PyModule_AddType(mod, &vector_Type); + PyModule_AddType(mod, &matrix_Type); + PyModule_AddType(mod, &euler_Type); + PyModule_AddType(mod, &quaternion_Type); + PyModule_AddType(mod, &color_Type); /* submodule */ PyModule_AddObject(mod, "geometry", (submodule = PyInit_mathutils_geometry())); diff --git a/source/blender/python/mathutils/mathutils_bvhtree.c b/source/blender/python/mathutils/mathutils_bvhtree.c index 1d477421e30..0f3e54dc41f 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.c +++ b/source/blender/python/mathutils/mathutils_bvhtree.c @@ -1331,7 +1331,7 @@ PyMODINIT_FUNC PyInit_mathutils_bvhtree(void) return NULL; } - PyModule_AddObject(m, "BVHTree", (PyObject *)&PyBVHTree_Type); + PyModule_AddType(m, &PyBVHTree_Type); return m; } diff --git a/source/blender/python/mathutils/mathutils_kdtree.c b/source/blender/python/mathutils/mathutils_kdtree.c index 1de3c23838f..fe8f9ec0334 100644 --- a/source/blender/python/mathutils/mathutils_kdtree.c +++ b/source/blender/python/mathutils/mathutils_kdtree.c @@ -459,7 +459,7 @@ PyMODINIT_FUNC PyInit_mathutils_kdtree(void) if (PyType_Ready(&PyKDTree_Type)) { return NULL; } - PyModule_AddObject(m, "KDTree", (PyObject *)&PyKDTree_Type); + PyModule_AddType(m, &PyKDTree_Type); return m; } |