diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-02-12 00:08:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-02-12 00:08:16 +0300 |
commit | aa43e2ec29a9f73918b12001c6e4f4b4c63fd9c9 (patch) | |
tree | 17cb05debbb5fd7e38e65898a083382eb79e1f82 /source/blender/python/mathutils | |
parent | d21f44546951a29cea5524fcd2147e08de996c7d (diff) |
PyAPI: use PyModule_AddType utility function
Diffstat (limited to 'source/blender/python/mathutils')
-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 |
3 files changed, 7 insertions, 7 deletions
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; } |